Skip to content

Commit 92588f5

Browse files
committed
partitioned shall not pass
1 parent 295e9b6 commit 92588f5

File tree

1 file changed

+20
-13
lines changed
  • crates/integrations/datafusion/src/table

1 file changed

+20
-13
lines changed

crates/integrations/datafusion/src/table/mod.rs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl TableProvider for IcebergTableProvider {
162162
fn supports_filters_pushdown(
163163
&self,
164164
filters: &[&Expr],
165-
) -> std::result::Result<Vec<TableProviderFilterPushDown>, datafusion::error::DataFusionError>
165+
) -> std::result::Result<Vec<TableProviderFilterPushDown>, DataFusionError>
166166
{
167167
// Push down all filters, as a single source of truth, the scanner will drop the filters which couldn't be push down
168168
Ok(vec![TableProviderFilterPushDown::Inexact; filters.len()])
@@ -174,24 +174,31 @@ impl TableProvider for IcebergTableProvider {
174174
input: Arc<dyn ExecutionPlan>,
175175
_insert_op: InsertOp,
176176
) -> DFResult<Arc<dyn ExecutionPlan>> {
177+
if !self.table.metadata().default_partition_spec().is_unpartitioned() {
178+
// TODO add insert into support for partitioned tables
179+
return Err(DataFusionError::NotImplemented(
180+
"IcebergTableProvider::insert_into does not support partitioned tables yet".to_string()
181+
));
182+
}
183+
184+
let Some(catalog) = self.catalog.clone() else {
185+
return Err(DataFusionError::Execution(
186+
"Catalog cannot be none for insert_into".to_string(),
187+
));
188+
};
189+
177190
let write_plan = Arc::new(IcebergWriteExec::new(
178191
self.table.clone(),
179192
input,
180193
self.schema.clone(),
181194
));
182195

183-
if let Some(catalog) = self.catalog.clone() {
184-
Ok(Arc::new(IcebergCommitExec::new(
185-
self.table.clone(),
186-
catalog,
187-
write_plan,
188-
self.schema.clone(),
189-
)))
190-
} else {
191-
Err(DataFusionError::Execution(
192-
"Catalog cannot be none for insert_into".to_string(),
193-
))
194-
}
196+
Ok(Arc::new(IcebergCommitExec::new(
197+
self.table.clone(),
198+
catalog,
199+
write_plan,
200+
self.schema.clone(),
201+
)))
195202
}
196203
}
197204

0 commit comments

Comments
 (0)