@@ -342,26 +342,28 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
342342 refresh_mode,
343343 initialize,
344344 require_user,
345+ partition_of,
346+ for_values,
345347 } ) => {
346348 if temporary {
347- return not_impl_err ! ( "Temporary tables not supported" ) ? ;
349+ return not_impl_err ! ( "Temporary tables not supported" ) ;
348350 }
349351 if external {
350- return not_impl_err ! ( "External tables not supported" ) ? ;
352+ return not_impl_err ! ( "External tables not supported" ) ;
351353 }
352354 if global. is_some ( ) {
353- return not_impl_err ! ( "Global tables not supported" ) ? ;
355+ return not_impl_err ! ( "Global tables not supported" ) ;
354356 }
355357 if transient {
356- return not_impl_err ! ( "Transient tables not supported" ) ? ;
358+ return not_impl_err ! ( "Transient tables not supported" ) ;
357359 }
358360 if volatile {
359- return not_impl_err ! ( "Volatile tables not supported" ) ? ;
361+ return not_impl_err ! ( "Volatile tables not supported" ) ;
360362 }
361363 if hive_distribution != ast:: HiveDistributionStyle :: NONE {
362364 return not_impl_err ! (
363365 "Hive distribution not supported: {hive_distribution:?}"
364- ) ? ;
366+ ) ;
365367 }
366368 if hive_formats. is_some ( )
367369 && !matches ! (
@@ -374,122 +376,126 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
374376 } )
375377 )
376378 {
377- return not_impl_err ! (
378- "Hive formats not supported: {hive_formats:?}"
379- ) ?;
379+ return not_impl_err ! ( "Hive formats not supported: {hive_formats:?}" ) ;
380380 }
381381 if file_format. is_some ( ) {
382- return not_impl_err ! ( "File format not supported" ) ? ;
382+ return not_impl_err ! ( "File format not supported" ) ;
383383 }
384384 if location. is_some ( ) {
385- return not_impl_err ! ( "Location not supported" ) ? ;
385+ return not_impl_err ! ( "Location not supported" ) ;
386386 }
387387 if without_rowid {
388- return not_impl_err ! ( "Without rowid not supported" ) ? ;
388+ return not_impl_err ! ( "Without rowid not supported" ) ;
389389 }
390390 if like. is_some ( ) {
391- return not_impl_err ! ( "Like not supported" ) ? ;
391+ return not_impl_err ! ( "Like not supported" ) ;
392392 }
393393 if clone. is_some ( ) {
394- return not_impl_err ! ( "Clone not supported" ) ? ;
394+ return not_impl_err ! ( "Clone not supported" ) ;
395395 }
396396 if comment. is_some ( ) {
397- return not_impl_err ! ( "Comment not supported" ) ? ;
397+ return not_impl_err ! ( "Comment not supported" ) ;
398398 }
399399 if on_commit. is_some ( ) {
400- return not_impl_err ! ( "On commit not supported" ) ? ;
400+ return not_impl_err ! ( "On commit not supported" ) ;
401401 }
402402 if on_cluster. is_some ( ) {
403- return not_impl_err ! ( "On cluster not supported" ) ? ;
403+ return not_impl_err ! ( "On cluster not supported" ) ;
404404 }
405405 if primary_key. is_some ( ) {
406- return not_impl_err ! ( "Primary key not supported" ) ? ;
406+ return not_impl_err ! ( "Primary key not supported" ) ;
407407 }
408408 if order_by. is_some ( ) {
409- return not_impl_err ! ( "Order by not supported" ) ? ;
409+ return not_impl_err ! ( "Order by not supported" ) ;
410410 }
411411 if partition_by. is_some ( ) {
412- return not_impl_err ! ( "Partition by not supported" ) ? ;
412+ return not_impl_err ! ( "Partition by not supported" ) ;
413413 }
414414 if cluster_by. is_some ( ) {
415- return not_impl_err ! ( "Cluster by not supported" ) ? ;
415+ return not_impl_err ! ( "Cluster by not supported" ) ;
416416 }
417417 if clustered_by. is_some ( ) {
418- return not_impl_err ! ( "Clustered by not supported" ) ? ;
418+ return not_impl_err ! ( "Clustered by not supported" ) ;
419419 }
420420 if strict {
421- return not_impl_err ! ( "Strict not supported" ) ? ;
421+ return not_impl_err ! ( "Strict not supported" ) ;
422422 }
423423 if copy_grants {
424- return not_impl_err ! ( "Copy grants not supported" ) ? ;
424+ return not_impl_err ! ( "Copy grants not supported" ) ;
425425 }
426426 if enable_schema_evolution. is_some ( ) {
427- return not_impl_err ! ( "Enable schema evolution not supported" ) ? ;
427+ return not_impl_err ! ( "Enable schema evolution not supported" ) ;
428428 }
429429 if change_tracking. is_some ( ) {
430- return not_impl_err ! ( "Change tracking not supported" ) ? ;
430+ return not_impl_err ! ( "Change tracking not supported" ) ;
431431 }
432432 if data_retention_time_in_days. is_some ( ) {
433- return not_impl_err ! ( "Data retention time in days not supported" ) ? ;
433+ return not_impl_err ! ( "Data retention time in days not supported" ) ;
434434 }
435435 if max_data_extension_time_in_days. is_some ( ) {
436436 return not_impl_err ! (
437437 "Max data extension time in days not supported"
438- ) ? ;
438+ ) ;
439439 }
440440 if default_ddl_collation. is_some ( ) {
441- return not_impl_err ! ( "Default DDL collation not supported" ) ? ;
441+ return not_impl_err ! ( "Default DDL collation not supported" ) ;
442442 }
443443 if with_aggregation_policy. is_some ( ) {
444- return not_impl_err ! ( "With aggregation policy not supported" ) ? ;
444+ return not_impl_err ! ( "With aggregation policy not supported" ) ;
445445 }
446446 if with_row_access_policy. is_some ( ) {
447- return not_impl_err ! ( "With row access policy not supported" ) ? ;
447+ return not_impl_err ! ( "With row access policy not supported" ) ;
448448 }
449449 if with_tags. is_some ( ) {
450- return not_impl_err ! ( "With tags not supported" ) ? ;
450+ return not_impl_err ! ( "With tags not supported" ) ;
451451 }
452452 if iceberg {
453- return not_impl_err ! ( "Iceberg not supported" ) ? ;
453+ return not_impl_err ! ( "Iceberg not supported" ) ;
454454 }
455455 if external_volume. is_some ( ) {
456- return not_impl_err ! ( "External volume not supported" ) ? ;
456+ return not_impl_err ! ( "External volume not supported" ) ;
457457 }
458458 if base_location. is_some ( ) {
459- return not_impl_err ! ( "Base location not supported" ) ? ;
459+ return not_impl_err ! ( "Base location not supported" ) ;
460460 }
461461 if catalog. is_some ( ) {
462- return not_impl_err ! ( "Catalog not supported" ) ? ;
462+ return not_impl_err ! ( "Catalog not supported" ) ;
463463 }
464464 if catalog_sync. is_some ( ) {
465- return not_impl_err ! ( "Catalog sync not supported" ) ? ;
465+ return not_impl_err ! ( "Catalog sync not supported" ) ;
466466 }
467467 if storage_serialization_policy. is_some ( ) {
468- return not_impl_err ! ( "Storage serialization policy not supported" ) ? ;
468+ return not_impl_err ! ( "Storage serialization policy not supported" ) ;
469469 }
470470 if inherits. is_some ( ) {
471- return not_impl_err ! ( "Table inheritance not supported" ) ? ;
471+ return not_impl_err ! ( "Table inheritance not supported" ) ;
472472 }
473473 if dynamic {
474- return not_impl_err ! ( "Dynamic tables not supported" ) ? ;
474+ return not_impl_err ! ( "Dynamic tables not supported" ) ;
475475 }
476476 if version. is_some ( ) {
477- return not_impl_err ! ( "Version not supported" ) ? ;
477+ return not_impl_err ! ( "Version not supported" ) ;
478478 }
479479 if target_lag. is_some ( ) {
480- return not_impl_err ! ( "Target lag not supported" ) ? ;
480+ return not_impl_err ! ( "Target lag not supported" ) ;
481481 }
482482 if warehouse. is_some ( ) {
483- return not_impl_err ! ( "Warehouse not supported" ) ? ;
483+ return not_impl_err ! ( "Warehouse not supported" ) ;
484484 }
485485 if refresh_mode. is_some ( ) {
486- return not_impl_err ! ( "Refresh mode not supported" ) ? ;
486+ return not_impl_err ! ( "Refresh mode not supported" ) ;
487487 }
488488 if initialize. is_some ( ) {
489- return not_impl_err ! ( "Initialize not supported" ) ? ;
489+ return not_impl_err ! ( "Initialize not supported" ) ;
490490 }
491491 if require_user {
492- return not_impl_err ! ( "Require user not supported" ) ?;
492+ return not_impl_err ! ( "Require user not supported" ) ;
493+ }
494+ if partition_of. is_some ( ) {
495+ return not_impl_err ! ( "PARTITION OF not supported" ) ;
496+ }
497+ if for_values. is_some ( ) {
498+ return not_impl_err ! ( "PARTITION OF .. FOR VALUES .. not supported" ) ;
493499 }
494500 // Merge inline constraints and existing constraints
495501 let mut all_constraints = constraints;
@@ -989,7 +995,8 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
989995 has_table_keyword,
990996 settings,
991997 format_clause,
992- insert_token : _insert_token, // record the location the `INSERT` token
998+ insert_token : _, // record the location the `INSERT` token
999+ optimizer_hint,
9931000 } ) => {
9941001 let table_name = match table {
9951002 TableObject :: TableName ( table_name) => table_name,
@@ -1045,6 +1052,9 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10451052 if format_clause. is_some ( ) {
10461053 plan_err ! ( "Inserts with format clause not supported" ) ?;
10471054 }
1055+ if optimizer_hint. is_some ( ) {
1056+ plan_err ! ( "Optimizer hints not supported" ) ?;
1057+ }
10481058 // optional keywords don't change behavior
10491059 let _ = into;
10501060 let _ = has_table_keyword;
@@ -1059,6 +1069,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10591069 or,
10601070 limit,
10611071 update_token : _,
1072+ optimizer_hint,
10621073 } ) => {
10631074 let from_clauses =
10641075 from. map ( |update_table_from_kind| match update_table_from_kind {
@@ -1079,6 +1090,9 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10791090 if limit. is_some ( ) {
10801091 return not_impl_err ! ( "Update-limit clause not supported" ) ?;
10811092 }
1093+ if optimizer_hint. is_some ( ) {
1094+ plan_err ! ( "Optimizer hints not supported" ) ?;
1095+ }
10821096 self . update_to_plan ( table, & assignments, update_from, selection)
10831097 }
10841098
@@ -1091,6 +1105,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
10911105 order_by,
10921106 limit,
10931107 delete_token : _,
1108+ optimizer_hint,
10941109 } ) => {
10951110 if !tables. is_empty ( ) {
10961111 plan_err ! ( "DELETE <TABLE> not supported" ) ?;
@@ -1108,6 +1123,10 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
11081123 plan_err ! ( "Delete-order-by clause not yet supported" ) ?;
11091124 }
11101125
1126+ if optimizer_hint. is_some ( ) {
1127+ plan_err ! ( "Optimizer hints not supported" ) ?;
1128+ }
1129+
11111130 let table_name = self . get_delete_target ( from) ?;
11121131 self . delete_to_plan ( & table_name, selection, limit)
11131132 }
@@ -1393,6 +1412,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
13931412 cascade,
13941413 on_cluster,
13951414 table,
1415+ if_exists,
13961416 } ) => {
13971417 let _ = table; // Support TRUNCATE TABLE and TRUNCATE syntax
13981418 if table_names. len ( ) != 1 {
@@ -1421,6 +1441,9 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
14211441 if on_cluster. is_some ( ) {
14221442 return not_impl_err ! ( "TRUNCATE with ON CLUSTER is not supported" ) ;
14231443 }
1444+ if if_exists {
1445+ return not_impl_err ! ( "TRUNCATE .. with IF EXISTS is not supported" ) ;
1446+ }
14241447 let table = self . object_name_to_table_reference ( target. name . clone ( ) ) ?;
14251448 let source = self . context_provider . get_table_source ( table. clone ( ) ) ?;
14261449
0 commit comments