@@ -52,7 +52,7 @@ use datafusion_expr::{
5252 TransactionConclusion , TransactionEnd , TransactionIsolationLevel , TransactionStart ,
5353 Volatility , WriteOp ,
5454} ;
55- use sqlparser:: ast;
55+ use sqlparser:: ast:: { self , AssignmentTarget , CreateTable } ;
5656use sqlparser:: ast:: {
5757 Assignment , ColumnDef , CreateTableOptions , Delete , DescribeAlias , Expr as SQLExpr ,
5858 Expr , FromTable , Ident , Insert , ObjectName , ObjectType , OneOrManyWithParens , Query ,
@@ -240,7 +240,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
240240 value,
241241 } => self . set_variable_to_plan ( local, hivevar, & variables, value) ,
242242
243- Statement :: CreateTable {
243+ Statement :: CreateTable ( CreateTable {
244244 query,
245245 name,
246246 columns,
@@ -250,7 +250,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
250250 if_not_exists,
251251 or_replace,
252252 ..
253- } if table_properties. is_empty ( ) && with_options. is_empty ( ) => {
253+ } ) if table_properties. is_empty ( ) && with_options. is_empty ( ) => {
254254 // Merge inline constraints and existing constraints
255255 let mut all_constraints = constraints;
256256 let inline_constraints = calc_inline_constraints_from_columns ( & columns) ;
@@ -1284,8 +1284,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
12841284 let mut assign_map = assignments
12851285 . iter ( )
12861286 . map ( |assign| {
1287- let col_name: & Ident = assign
1288- . id
1287+ let cols = match & assign. target {
1288+ AssignmentTarget :: ColumnName ( cols) => cols,
1289+ _ => plan_err ! ( "Tuples are not supported" ) ?,
1290+ } ;
1291+ let col_name: & Ident = cols
1292+ . 0
12891293 . iter ( )
12901294 . last ( )
12911295 . ok_or_else ( || plan_datafusion_err ! ( "Empty column id" ) ) ?;
0 commit comments