rdblue commented on a change in pull request #1843:
URL: https://github.com/apache/iceberg/pull/1843#discussion_r536929426
##########
File path: spark3/src/main/java/org/apache/iceberg/spark/SparkCatalog.java
##########
@@ -147,13 +156,23 @@ public SparkTable createTable(Identifier ident,
StructType schema,
Transform[] transforms,
Map<String, String> properties) throws
TableAlreadyExistsException {
Schema icebergSchema = SparkSchemaUtil.convert(schema);
+ TableIdentifier tableIdentifier = buildIdentifier(ident);
try {
- Table icebergTable = icebergCatalog.createTable(
- buildIdentifier(ident),
- icebergSchema,
- Spark3Util.toPartitionSpec(icebergSchema, transforms),
- properties.get("location"),
- Spark3Util.rebuildCreateProperties(properties));
+ Table icebergTable;
+ if (isPathIdentifier(ident)) {
Review comment:
I think this would be cleaner using the builder. The only problem there
is that the builder isn't implemented for `CachingCatalog` yet. I'll open a PR
with that builder. Then you'd be able to have an if to create the builder, then
configure the builder the same way for spec, properties, identifier, etc.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]