szehon-ho commented on code in PR #18250:
URL: https://github.com/apache/iceberg/pull/18250#discussion_r4109630213
##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -221,17 +219,16 @@ public Table createTable(
}
@Override
- public StagedTable stageCreate(
- Identifier ident, StructType schema, Transform[] transforms, Map<String,
String> properties)
- throws TableAlreadyExistsException {
- Schema icebergSchema = SparkSchemaUtil.convert(schema);
+ public StagedTable stageCreate(Identifier ident, TableInfo tableInfo)
+ throws TableAlreadyExistsException, NoSuchNamespaceException {
+ Schema icebergSchema = SparkSchemaUtil.convert(tableInfo);
Review Comment:
This would make CTAS fail when the selected schema contains column defaults.
Spark reconstructs these defaults with a SQL string but no expression, so
selecting a column with `DEFAULT 7` would reach `Unsupported default value
expression: 7`.
I think CTAS should not have defaults , right?
We could use `SparkSchemaUtil.convert(tableInfo.schema())` here to ignore
defaults in the selected schema.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]