amanomer commented on issue #26293: [SPARK-29595][SQL] Insertion with named_struct should match by name URL: https://github.com/apache/spark/pull/26293#issuecomment-549666004 `$ insert into str ((b, a) as data) values named_struct('b', 4, 'a', 1);` This throws compilation error in spark as well as hive. I think, spark does not support providing column names in INSERT INTO statement. That's why while preprocessing INSERT statement _byName_ is always set as _false_. https://github.com/apache/spark/blob/942a057934554d9f9edc591af74dea490d926eef/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala#L402-L403 This allows successful insertion by queries like `$ insert into str values named_struct('abc', 4, 'xyz', 1);` For NAMED_STRUCT, where we need to pass field names, I propose that we should ignore _byName_ value and always match field names before insertion?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
