[ https://issues.apache.org/jira/browse/HUDI-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
waywtdcc updated HUDI-5088: --------------------------- Description: The flash table failed to synchronize the hive metadata. After using the flash catalog and specifying changlog.enabled=true, the real-time writing to the table fails to synchronize the hive metadata. * sql * {code:java} CREATE TABLE datagen ( id INT, name string, ts3 timestamp(3) ) WITH ( 'connector' = 'datagen', 'rows-per-second'='10', 'fields.id.kind'='sequence', 'fields.id.start'='1', 'fields.id.end'='1000' ); CREATE CATALOG myhudi WITH( 'type' = 'hudi', 'default-database' = 'default', 'catalog.path' = '/user/hdpu/warehouse', 'mode' = 'hms', 'hive.conf.dir' = 'hdfs:///user/hdpu/streamx/conf_data/hive_conf', -- table-prop. properties.It is used to add attributes by default when creating tables. 'table-prop.connector' = 'hudi', 'table-prop.table.type' = 'MERGE_ON_READ', 'table-prop.compaction.tasks' = '1', 'table-prop.write.tasks' = '1', 'table-prop.index.bootstrap.enabled' = 'true', 'table-prop.read.utc-timezone' = 'false', 'table-prop.changelog.enabled' = 'true', 'table-prop.index.global.enabled' = 'true' ); CREATE CATALOG myhive WITH ( 'type' = 'hive', 'default-database' = 'default', 'hive-conf-dir' = 'hdfs:///user/hdpu/streamx/conf_data/hive_conf' ); drop table if exists myhive.test_hudi3.hudi_datagen_incre; drop table if exists myhudi.test_hudi3.hudi_datagen_incre; create table if not exists myhudi.test_hudi3.hudi_datagen_incre (id bigint not null, name string,ts3 timestamp(3) ,PRIMARY KEY (`id`) NOT ENFORCED ) ; show create table myhudi.test_hudi3.hudi_datagen_incre; insert into myhudi.test_hudi3.hudi_datagen_incre select id,name,ts3 from datagen; {code} * error {code:java} 22/10/25 13:55:01 ERROR HMSDDLExecutor: Failed to update table for hudi_datagen_incre_ro InvalidOperationException(message:The following columns have types incompatible with the existing columns in their respective positions : id) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59744) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59730) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:59672) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1693) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1677) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table_with_environmentContext(HiveMetaStoreClient.java:375) at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table_with_environmentContext(SessionHiveMetaStoreClient.java:322) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173) at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2336) at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown Source) at org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:158) at org.apache.hudi.hive.HoodieHiveSyncClient.updateTableSchema(HoodieHiveSyncClient.java:169) at org.apache.hudi.hive.HiveSyncTool.syncSchema(HiveSyncTool.java:289) at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:217) at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:158) at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:142) at org.apache.hudi.sink.StreamWriteOperatorCoordinator.doSyncHive(StreamWriteOperatorCoordinator.java:327) at org.apache.hudi.sink.utils.NonThrownExecutor.lambda$wrapAction$0(NonThrownExecutor.java:130) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 22/10/25 13:55:01 INFO metastore: Closed a connection to metastore, current connections: 2 22/10/25 13:55:01 ERROR StreamWriteOperatorCoordinator: Executor executes action [sync hive metadata for instant 20221025135500902] error org.apache.hudi.exception.HoodieException: Got runtime exception when hive syncing hudi_datagen_incre at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:145) at org.apache.hudi.sink.StreamWriteOperatorCoordinator.doSyncHive(StreamWriteOperatorCoordinator.java:327) at org.apache.hudi.sink.utils.NonThrownExecutor.lambda$wrapAction$0(NonThrownExecutor.java:130) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.hudi.hive.HoodieHiveSyncException: Failed to update table for hudi_datagen_incre_ro at org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:161) at org.apache.hudi.hive.HoodieHiveSyncClient.updateTableSchema(HoodieHiveSyncClient.java:169) at org.apache.hudi.hive.HiveSyncTool.syncSchema(HiveSyncTool.java:289) at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:217) at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:158) at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:142) ... 5 more Caused by: InvalidOperationException(message:The following columns have types incompatible with the existing columns in their respective positions : id) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59744) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59730) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:59672) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1693) at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1677) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table_with_environmentContext(HiveMetaStoreClient.java:375) at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table_with_environmentContext(SessionHiveMetaStoreClient.java:322) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173) at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2336) at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown Source) at org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:158) ... 10 more 22/10/25 13:55:04 INFO PermanentBlobCache: Shutting down BLOB cache 22/10/25 13:55:04 INFO TaskExecutorStateChangelogStoragesManager: Shutting down TaskExecutorStateChangelogStoragesManager. 22/10/25 13:55:04 INFO TaskExecutorLocalStateStoresManager: Shutting down TaskExecutorLocalStateStoresManager. 22/10/25 13:55:04 INFO TransientBlobCache: Shutting down BLOB cache 22/10/25 13:55:04 INFO FileChannelManagerImpl: FileChannelManager removed spill file directory C:\Users\CHENCH~1\AppData\Local\Temp\flink-io-85e079a0-9ddd-4a24-93ef-bedbe7ceb4bd 22/10/25 13:55:04 INFO BlobServer: Stopped BLOB server at 0.0.0.0:64860 22/10/25 13:55:04 INFO FileCache: removed file cache directory C:\Users\CHENCH~1\AppData\Local\Temp\flink-dist-cache-467c6e08-9173-4fa7-81b2-f4411b3167b6 22/10/25 13:55:04 INFO FileChannelManagerImpl: FileChannelManager removed spill file directory C:\Users\CHENCH~1\AppData\Local\Temp\flink-netty-shuffle-4a0bcf54-acde-410e-82a9-6d808dd35ca7Process finished with exit code 130 {code} was:The flash table failed to synchronize the hive metadata. After using the flash catalog and specifying changlog.enabled=true, the real-time writing to the table fails to synchronize the hive metadata. > Failed to synchronize the hive metadata of the Flink table > ---------------------------------------------------------- > > Key: HUDI-5088 > URL: https://issues.apache.org/jira/browse/HUDI-5088 > Project: Apache Hudi > Issue Type: Bug > Components: flink-sql > Reporter: waywtdcc > Priority: Major > Fix For: 0.12.1 > > > The flash table failed to synchronize the hive metadata. After using the > flash catalog and specifying changlog.enabled=true, the real-time writing to > the table fails to synchronize the hive metadata. > > * sql > * > {code:java} > CREATE TABLE datagen ( > id INT, > name string, > ts3 timestamp(3) > ) WITH ( > 'connector' = 'datagen', > 'rows-per-second'='10', > 'fields.id.kind'='sequence', > 'fields.id.start'='1', > 'fields.id.end'='1000' > ); > CREATE CATALOG myhudi WITH( > 'type' = 'hudi', > 'default-database' = 'default', > 'catalog.path' = '/user/hdpu/warehouse', > 'mode' = 'hms', > 'hive.conf.dir' = 'hdfs:///user/hdpu/streamx/conf_data/hive_conf', > -- table-prop. properties.It is used to add attributes by default when > creating tables. 'table-prop.connector' = 'hudi', > 'table-prop.table.type' = 'MERGE_ON_READ', > 'table-prop.compaction.tasks' = '1', > 'table-prop.write.tasks' = '1', > 'table-prop.index.bootstrap.enabled' = 'true', > 'table-prop.read.utc-timezone' = 'false', > 'table-prop.changelog.enabled' = 'true', > 'table-prop.index.global.enabled' = 'true' > ); > CREATE CATALOG myhive WITH ( > 'type' = 'hive', > 'default-database' = 'default', > 'hive-conf-dir' = 'hdfs:///user/hdpu/streamx/conf_data/hive_conf' > ); > drop table if exists myhive.test_hudi3.hudi_datagen_incre; > drop table if exists myhudi.test_hudi3.hudi_datagen_incre; > create table if not exists myhudi.test_hudi3.hudi_datagen_incre > (id bigint not null, name string,ts3 timestamp(3) > ,PRIMARY KEY (`id`) NOT ENFORCED > ) > ; > show create table myhudi.test_hudi3.hudi_datagen_incre; > insert into myhudi.test_hudi3.hudi_datagen_incre > select id,name,ts3 > from datagen; > {code} > * error > {code:java} > 22/10/25 13:55:01 ERROR HMSDDLExecutor: Failed to update table for > hudi_datagen_incre_ro > InvalidOperationException(message:The following columns have types > incompatible with the existing columns in their respective positions : > id) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59744) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59730) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:59672) > at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1693) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1677) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table_with_environmentContext(HiveMetaStoreClient.java:375) > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table_with_environmentContext(SessionHiveMetaStoreClient.java:322) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173) > at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown > Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2336) > at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown > Source) > at > org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:158) > at > org.apache.hudi.hive.HoodieHiveSyncClient.updateTableSchema(HoodieHiveSyncClient.java:169) > at org.apache.hudi.hive.HiveSyncTool.syncSchema(HiveSyncTool.java:289) > at > org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:217) > at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:158) > at > org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:142) > at > org.apache.hudi.sink.StreamWriteOperatorCoordinator.doSyncHive(StreamWriteOperatorCoordinator.java:327) > at > org.apache.hudi.sink.utils.NonThrownExecutor.lambda$wrapAction$0(NonThrownExecutor.java:130) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748) > 22/10/25 13:55:01 INFO metastore: Closed a connection to metastore, current > connections: 2 > 22/10/25 13:55:01 ERROR StreamWriteOperatorCoordinator: Executor executes > action [sync hive metadata for instant 20221025135500902] error > org.apache.hudi.exception.HoodieException: Got runtime exception when hive > syncing hudi_datagen_incre > at > org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:145) > at > org.apache.hudi.sink.StreamWriteOperatorCoordinator.doSyncHive(StreamWriteOperatorCoordinator.java:327) > at > org.apache.hudi.sink.utils.NonThrownExecutor.lambda$wrapAction$0(NonThrownExecutor.java:130) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748) > Caused by: org.apache.hudi.hive.HoodieHiveSyncException: Failed to update > table for hudi_datagen_incre_ro > at > org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:161) > at > org.apache.hudi.hive.HoodieHiveSyncClient.updateTableSchema(HoodieHiveSyncClient.java:169) > at org.apache.hudi.hive.HiveSyncTool.syncSchema(HiveSyncTool.java:289) > at > org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:217) > at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:158) > at > org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:142) > ... 5 more > Caused by: InvalidOperationException(message:The following columns have types > incompatible with the existing columns in their respective positions : > id) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59744) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result$alter_table_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:59730) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_with_environment_context_result.read(ThriftHiveMetastore.java:59672) > at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_with_environment_context(ThriftHiveMetastore.java:1693) > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_with_environment_context(ThriftHiveMetastore.java:1677) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table_with_environmentContext(HiveMetaStoreClient.java:375) > at > org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table_with_environmentContext(SessionHiveMetaStoreClient.java:322) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:173) > at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown > Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2336) > at com.sun.proxy.$Proxy32.alter_table_with_environmentContext(Unknown > Source) > at > org.apache.hudi.hive.ddl.HMSDDLExecutor.updateTableDefinition(HMSDDLExecutor.java:158) > ... 10 more > 22/10/25 13:55:04 INFO PermanentBlobCache: Shutting down BLOB cache > 22/10/25 13:55:04 INFO TaskExecutorStateChangelogStoragesManager: Shutting > down TaskExecutorStateChangelogStoragesManager. > 22/10/25 13:55:04 INFO TaskExecutorLocalStateStoresManager: Shutting down > TaskExecutorLocalStateStoresManager. > 22/10/25 13:55:04 INFO TransientBlobCache: Shutting down BLOB cache > 22/10/25 13:55:04 INFO FileChannelManagerImpl: FileChannelManager removed > spill file directory > C:\Users\CHENCH~1\AppData\Local\Temp\flink-io-85e079a0-9ddd-4a24-93ef-bedbe7ceb4bd > 22/10/25 13:55:04 INFO BlobServer: Stopped BLOB server at 0.0.0.0:64860 > 22/10/25 13:55:04 INFO FileCache: removed file cache directory > C:\Users\CHENCH~1\AppData\Local\Temp\flink-dist-cache-467c6e08-9173-4fa7-81b2-f4411b3167b6 > 22/10/25 13:55:04 INFO FileChannelManagerImpl: FileChannelManager removed > spill file directory > C:\Users\CHENCH~1\AppData\Local\Temp\flink-netty-shuffle-4a0bcf54-acde-410e-82a9-6d808dd35ca7Process > finished with exit code 130 > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)