@@ -222,6 +222,15 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
222
222
} => self . set_variable_to_plan ( local, hivevar, & variables, value) ,
223
223
224
224
Statement :: CreateTable ( CreateTable {
225
+ temporary,
226
+ external,
227
+ global,
228
+ transient,
229
+ volatile,
230
+ hive_distribution,
231
+ hive_formats,
232
+ file_format,
233
+ location,
225
234
query,
226
235
name,
227
236
columns,
@@ -230,8 +239,149 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
230
239
with_options,
231
240
if_not_exists,
232
241
or_replace,
233
- ..
242
+ without_rowid,
243
+ like,
244
+ clone,
245
+ engine,
246
+ comment,
247
+ auto_increment_offset,
248
+ default_charset,
249
+ collation,
250
+ on_commit,
251
+ on_cluster,
252
+ primary_key,
253
+ order_by,
254
+ partition_by,
255
+ cluster_by,
256
+ options,
257
+ strict,
258
+ copy_grants,
259
+ enable_schema_evolution,
260
+ change_tracking,
261
+ data_retention_time_in_days,
262
+ max_data_extension_time_in_days,
263
+ default_ddl_collation,
264
+ with_aggregation_policy,
265
+ with_row_access_policy,
266
+ with_tags,
234
267
} ) if table_properties. is_empty ( ) && with_options. is_empty ( ) => {
268
+ if temporary {
269
+ return not_impl_err ! ( "Temporary tables not supported" ) ?;
270
+ }
271
+ if external {
272
+ return not_impl_err ! ( "External tables not supported" ) ?;
273
+ }
274
+ if global. is_some ( ) {
275
+ return not_impl_err ! ( "Global tables not supported" ) ?;
276
+ }
277
+ if transient {
278
+ return not_impl_err ! ( "Transient tables not supported" ) ?;
279
+ }
280
+ if volatile {
281
+ return not_impl_err ! ( "Volatile tables not supported" ) ?;
282
+ }
283
+ if hive_distribution != ast:: HiveDistributionStyle :: NONE {
284
+ return not_impl_err ! (
285
+ "Hive distribution not supported: {hive_distribution:?}"
286
+ ) ?;
287
+ }
288
+ if !matches ! (
289
+ hive_formats,
290
+ Some ( ast:: HiveFormat {
291
+ row_format: None ,
292
+ serde_properties: None ,
293
+ storage: None ,
294
+ location: None ,
295
+ } )
296
+ ) {
297
+ return not_impl_err ! (
298
+ "Hive formats not supported: {hive_formats:?}"
299
+ ) ?;
300
+ }
301
+ if file_format. is_some ( ) {
302
+ return not_impl_err ! ( "File format not supported" ) ?;
303
+ }
304
+ if location. is_some ( ) {
305
+ return not_impl_err ! ( "Location not supported" ) ?;
306
+ }
307
+ if without_rowid {
308
+ return not_impl_err ! ( "Without rowid not supported" ) ?;
309
+ }
310
+ if like. is_some ( ) {
311
+ return not_impl_err ! ( "Like not supported" ) ?;
312
+ }
313
+ if clone. is_some ( ) {
314
+ return not_impl_err ! ( "Clone not supported" ) ?;
315
+ }
316
+ if engine. is_some ( ) {
317
+ return not_impl_err ! ( "Engine not supported" ) ?;
318
+ }
319
+ if comment. is_some ( ) {
320
+ return not_impl_err ! ( "Comment not supported" ) ?;
321
+ }
322
+ if auto_increment_offset. is_some ( ) {
323
+ return not_impl_err ! ( "Auto increment offset not supported" ) ?;
324
+ }
325
+ if default_charset. is_some ( ) {
326
+ return not_impl_err ! ( "Default charset not supported" ) ?;
327
+ }
328
+ if collation. is_some ( ) {
329
+ return not_impl_err ! ( "Collation not supported" ) ?;
330
+ }
331
+ if on_commit. is_some ( ) {
332
+ return not_impl_err ! ( "On commit not supported" ) ?;
333
+ }
334
+ if on_cluster. is_some ( ) {
335
+ return not_impl_err ! ( "On cluster not supported" ) ?;
336
+ }
337
+ if primary_key. is_some ( ) {
338
+ return not_impl_err ! ( "Primary key not supported" ) ?;
339
+ }
340
+ if order_by. is_some ( ) {
341
+ return not_impl_err ! ( "Order by not supported" ) ?;
342
+ }
343
+ if partition_by. is_some ( ) {
344
+ return not_impl_err ! ( "Partition by not supported" ) ?;
345
+ }
346
+ if cluster_by. is_some ( ) {
347
+ return not_impl_err ! ( "Cluster by not supported" ) ?;
348
+ }
349
+ if options. is_some ( ) {
350
+ return not_impl_err ! ( "Options not supported" ) ?;
351
+ }
352
+ if strict {
353
+ return not_impl_err ! ( "Strict not supported" ) ?;
354
+ }
355
+ if copy_grants {
356
+ return not_impl_err ! ( "Copy grants not supported" ) ?;
357
+ }
358
+ if enable_schema_evolution. is_some ( ) {
359
+ return not_impl_err ! ( "Enable schema evolution not supported" ) ?;
360
+ }
361
+ if change_tracking. is_some ( ) {
362
+ return not_impl_err ! ( "Change tracking not supported" ) ?;
363
+ }
364
+ if data_retention_time_in_days. is_some ( ) {
365
+ return not_impl_err ! ( "Data retention time in days not supported" ) ?;
366
+ }
367
+ if max_data_extension_time_in_days. is_some ( ) {
368
+ return not_impl_err ! (
369
+ "Max data extension time in days not supported"
370
+ ) ?;
371
+ }
372
+ if default_ddl_collation. is_some ( ) {
373
+ return not_impl_err ! ( "Default DDL collation not supported" ) ?;
374
+ }
375
+ if with_aggregation_policy. is_some ( ) {
376
+ return not_impl_err ! ( "With aggregation policy not supported" ) ?;
377
+ }
378
+ if with_row_access_policy. is_some ( ) {
379
+ return not_impl_err ! ( "With row access policy not supported" ) ?;
380
+ }
381
+ if with_tags. is_some ( ) {
382
+ return not_impl_err ! ( "With tags not supported" ) ?;
383
+ }
384
+
235
385
// Merge inline constraints and existing constraints
236
386
let mut all_constraints = constraints;
237
387
let inline_constraints = calc_inline_constraints_from_columns ( & columns) ;
@@ -317,12 +467,40 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
317
467
318
468
Statement :: CreateView {
319
469
or_replace,
470
+ materialized,
320
471
name,
321
472
columns,
322
473
query,
323
474
options : CreateTableOptions :: None ,
324
- ..
475
+ cluster_by,
476
+ comment,
477
+ with_no_schema_binding,
478
+ if_not_exists,
479
+ temporary,
480
+ to,
325
481
} => {
482
+ if materialized {
483
+ return not_impl_err ! ( "Materialized views not supported" ) ?;
484
+ }
485
+ if !cluster_by. is_empty ( ) {
486
+ return not_impl_err ! ( "Cluster by not supported" ) ?;
487
+ }
488
+ if comment. is_some ( ) {
489
+ return not_impl_err ! ( "Comment not supported" ) ?;
490
+ }
491
+ if with_no_schema_binding {
492
+ return not_impl_err ! ( "With no schema binding not supported" ) ?;
493
+ }
494
+ if if_not_exists {
495
+ return not_impl_err ! ( "If not exists not supported" ) ?;
496
+ }
497
+ if temporary {
498
+ return not_impl_err ! ( "Temporary views not supported" ) ?;
499
+ }
500
+ if to. is_some ( ) {
501
+ return not_impl_err ! ( "To not supported" ) ?;
502
+ }
503
+
326
504
let columns = columns
327
505
. into_iter ( )
328
506
. map ( |view_column_def| {
0 commit comments