JingsongLi commented on code in PR #7475:
URL: https://github.com/apache/paimon/pull/7475#discussion_r3442808176
##########
paimon-core/src/main/java/org/apache/paimon/jdbc/JdbcCatalog.java:
##########
@@ -334,12 +344,17 @@ protected void dropTableImpl(Identifier identifier,
List<Path> externalPaths) {
@Override
protected void createTableImpl(Identifier identifier, Schema schema) {
try {
- // create table file
- SchemaManager schemaManager = getSchemaManager(identifier);
+ // Determine table location before table exists in JDBC
+ Path tableLocation = initialTableLocation(schema.options(),
identifier);
+ boolean externalTable =
+ syncTableProperties() &&
schema.options().containsKey(CoreOptions.PATH.key());
+
+ // create table file using the determined location
+ SchemaManager schemaManager = new SchemaManager(fileIO,
tableLocation);
Review Comment:
Custom paths should use a FileIO resolved from the custom path, not the
catalog warehouse. With a warehouse on one filesystem and `path` on another
(for example local/HDFS warehouse plus `s3://...` table path), this
`SchemaManager` writes/validates schema through the warehouse FileIO. The same
problem shows up when the table is loaded or altered because `JdbcCatalog`
still uses the inherited non-external metadata path and does not override
`fileIO(Path)` like `HiveCatalog` does. That breaks the "multiple
warehouses/buckets" use case. Please resolve FileIO from `tableLocation` and
make loaded custom-path tables use that path-based/external FileIO.
--
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]