@@ -162,7 +162,7 @@ impl TableProvider for IcebergTableProvider {
162
162
fn supports_filters_pushdown (
163
163
& self ,
164
164
filters : & [ & Expr ] ,
165
- ) -> std:: result:: Result < Vec < TableProviderFilterPushDown > , datafusion :: error :: DataFusionError >
165
+ ) -> std:: result:: Result < Vec < TableProviderFilterPushDown > , DataFusionError >
166
166
{
167
167
// Push down all filters, as a single source of truth, the scanner will drop the filters which couldn't be push down
168
168
Ok ( vec ! [ TableProviderFilterPushDown :: Inexact ; filters. len( ) ] )
@@ -174,24 +174,31 @@ impl TableProvider for IcebergTableProvider {
174
174
input : Arc < dyn ExecutionPlan > ,
175
175
_insert_op : InsertOp ,
176
176
) -> 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
+
177
190
let write_plan = Arc :: new ( IcebergWriteExec :: new (
178
191
self . table . clone ( ) ,
179
192
input,
180
193
self . schema . clone ( ) ,
181
194
) ) ;
182
195
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
+ ) ) )
195
202
}
196
203
}
197
204
0 commit comments