You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "wanglijie95 (via GitHub)" <gi...@apache.org> on 2023/11/08 03:54:05 UTC

[I] [Bug] UnsupportedOperationException thrown when using TableDescriptor in Flink Job [incubator-paimon]

wanglijie95 opened a new issue, #2283:
URL: https://github.com/apache/incubator-paimon/issues/2283

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/incubator-paimon/issues) and found nothing similar.
   
   
   ### Paimon version
   
   0.6-SNAPSHOT, master:87582a723ab660402c93ff231564f75e315e8349
   
   ### Compute Engine
   
   Flink 1.17.1
   
   ### Minimal reproduce step
   
   The exception:
   ```
   org.apache.flink.table.api.TableException: Could not execute CreateTable in path `paimon`.`default`.`test`
   
   	at org.apache.flink.table.catalog.CatalogManager.execute(CatalogManager.java:1296)
   	at org.apache.flink.table.catalog.CatalogManager.createTable(CatalogManager.java:946)
   	at org.apache.flink.table.api.internal.TableEnvironmentImpl.createTable(TableEnvironmentImpl.java:503)
   	at org.apache.paimon.flink.FlinkCatalogTest.testTableDescriptor(FlinkCatalogTest.java:576)
   Caused by: java.lang.UnsupportedOperationException
   	at java.util.Collections$UnmodifiableMap.remove(Collections.java:1462)
   	at org.apache.paimon.flink.FlinkCatalog.buildPaimonSchema(FlinkCatalog.java:304)
   	at org.apache.paimon.flink.FlinkCatalog.createTable(FlinkCatalog.java:283)
   	at org.apache.flink.table.catalog.CatalogManager.lambda$createTable$18(CatalogManager.java:957)
   	at org.apache.flink.table.catalog.CatalogManager.execute(CatalogManager.java:1290)
   	... 72 more
   ```
   
   Run the following test, you can reproduce the problem.
   ```
       @Test
       void testTableDescriptor() {
           final EnvironmentSettings settings =
                   EnvironmentSettings.newInstance().inBatchMode().build();
           final TableEnvironment tEnv = TableEnvironment.create(settings);
   
           // create paimon catalog
           tEnv.executeSql(
                           "CREATE CATALOG paimon WITH (\n"
                                   + "  'type' = 'paimon', \n"
                                   + "  'warehouse' = '/tmp')");
           tEnv.executeSql("USE CATALOG paimon");
   
           // create table
           TableDescriptor tableDescriptor =
                   TableDescriptor.forConnector("paimon")
                           .schema(Schema.newBuilder().build())
                           .build();
           tEnv.createTable("test", tableDescriptor);
           tEnv.executeSql("select * from test");
       }
   ```
   
   The root cause is that the [options in TableDesciptor](https://github.com/apache/flink/blob/e0240c782073f879a1a1e3fe22b45a38ee499c45/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableDescriptor.java#L67) is unmodifiable.
   
   ### What doesn't meet your expectations?
   
   Throw UnsupportedOperationException
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@paimon.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] UnsupportedOperationException thrown when using TableDescriptor in Flink Job [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on issue #2283:
URL: https://github.com/apache/incubator-paimon/issues/2283#issuecomment-1813635118

   Thanks! It is a bug.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] UnsupportedOperationException thrown when using TableDescriptor in Flink Job [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi closed issue #2283: [Bug] UnsupportedOperationException thrown when using TableDescriptor in Flink Job
URL: https://github.com/apache/incubator-paimon/issues/2283


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org