Archie-selfless opened a new issue, #6572:
URL: https://github.com/apache/hudi/issues/6572

   **_Tips before filing an issue_**
   
   - Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)? ✔️ 
   
   - Join the mailing list to engage in conversations and get faster support at 
[email protected]. ✔️ 
   
   - If you have triaged this as a bug, then file an 
[issue](https://issues.apache.org/jira/projects/HUDI/issues) directly. ✔️ 
   
   **Describe the problem you faced**
   
   Using Hudi-Tool DeltaStreamer ingestion data from Kafka, and writing 
hudi-table successfully. 
   But there was some error when I expected sync hive-tables and add patition 
in them. 
   On top of that weirdness, hive-table can be created but the `patition adding 
process` called **NullPointerException** !!
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   1. Using Debezium capture MySQL data into Kafka and enabling Kafka-Connector 
with Confluent Schema Registry managing the schema;
   2. Prepare the Environment including `deploy Spark-Master/Worker`, `start 
Hive-MetaStore Server`.
   3. Run the Spark Job via **spark-submit** script:
     ```bash
     spark-submit \
       --jars 
"/home/hadoop/app/spark/ex_jar/hudi-utilities-bundle_2.12-0.12.0.jar,/home/hadoop/app/spark/ex_jar/spark-avro_2.12-3.2.2.jar"
 \
       --master spark://web-65:7077 \
       --deploy-mode cluster \
       --driver-memory 1g \
       --driver-cores 2 \
       --executor-memory 1g \
       --total-executor-cores 2 \
       --class org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer \
         /home/hadoop/app/spark/ex_jar/hudi-utilities-bundle_2.12-0.12.0.jar \
       --table-type COPY_ON_WRITE \
       --op UPSERT \
       --target-base-path cosn://bigdata-1252394470/hudi/cdc/mysql/table2 \
       --target-table table2 \
       --continuous \
       --min-sync-interval-seconds 60 \
       --source-class 
org.apache.hudi.utilities.sources.debezium.MysqlDebeziumSource \
       --payload-class 
org.apache.hudi.common.model.debezium.MySqlDebeziumAvroPayload \
       --source-ordering-field id \
       --hoodie-conf schema.registry.url=http://web-65:8181 \
       --hoodie-conf 
hoodie.deltastreamer.schemaprovider.registry.url=http://web-65:8181/subjects/debezium-cdc-server-mysql2.test_db.table2-value/versions/latest
 \
       --hoodie-conf 
hoodie.deltastreamer.source.kafka.value.deserializer.class=io.confluent.kafka.serializers.KafkaAvroDeserializer
 \
       --hoodie-conf 
hoodie.deltastreamer.source.kafka.topic=debezium-cdc-server-mysql2.test_db.table2
 \
       --hoodie-conf bootstrap.servers=web-65:9092 \
       --hoodie-conf auto.offset.reset=earliest \
       --hoodie-conf hoodie.datasource.write.recordkey.field=id \
       --hoodie-conf hoodie.datasource.write.partitionpath.field=u_name \
       --enable-sync \
       --sync-tool-classes org.apache.hudi.hive.HiveSyncTool \
       --hoodie-conf 
hoodie.datasource.hive_sync.partition_extractor_class=org.apache.hudi.hive.MultiPartKeysValueExtractor
 \
       --hoodie-conf hoodie.datasource.write.hive_style_partitioning=true \
       --hoodie-conf hoodie.datasource.hive_sync.enable=true \
       --hoodie-conf hoodie.datasource.hive_sync.database=default \
       --hoodie-conf hoodie.datasource.hive_sync.table=hudi_mysql_table2 \
       --hoodie-conf hoodie.datasource.hive_sync.partition_fields=u_name \
       --hoodie-conf hoodie.datasource.hive_sync.use_jdbc=false \
       --hoodie-conf 
hoodie.datasource.hive_sync.metastore.uris=thrift://web-65:9083 \
       --hoodie-conf hoodie.datasource.hive_sync.mode=hms
     ```
   
   > my hostname is **web-65**, all component deployed on this machine except 
ZK\KAFKA.
   
   **Expected behavior**
   
   Hive table could be created and patition(s) be added.
   
   **Environment Description**
   
   * Hudi version : 0.12.0
   
   * Spark version : 3.2.2
   
   * Hive version : 2.3.9
   
   * Hadoop version : 2.7.5 (Useless, only for starting hive-metastore process)
   
   * Storage (HDFS/S3/GCS..) : Tencent COS
   
   * Running on Docker? (yes/no) : no
   
   
   **Additional context**
   
   
   
   **Stacktrace**
   
   ```bash
   22/09/02 11:13:15 INFO HoodieMergedLogRecordScanner: Size of file spilled to 
disk => 0
   22/09/02 11:13:15 INFO HoodieBackedTableMetadata: Opened 3 metadata log 
files (dataset instant=20220902111141862, metadata instant=20220902111141862) 
in 1986 ms
   22/09/02 11:13:15 INFO BaseTableMetadata: Listed partitions from metadata: 
#partitions=3
   22/09/02 11:13:15 INFO HiveSyncTool: Storage partitions scan complete. Found 
3
   22/09/02 11:13:15 INFO HiveSyncTool: New Partitions [u_name=A, u_name=B, 
u_name=C]
   22/09/02 11:13:15 INFO HMSDDLExecutor: Adding partitions 3 to table 
hudi_mysql_table2
   22/09/02 11:13:15 ERROR HMSDDLExecutor: default.hudi_mysql_table2 add 
partition failed
   MetaException(message:java.io.IOException: Got exception: 
java.io.IOException java.lang.NullPointerException)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result$add_partitions_req_resultStandardScheme.read(ThriftHiveMetastore.java)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result$add_partitions_req_resultStandardScheme.read(ThriftHiveMetastore.java)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result.read(ThriftHiveMetastore.java)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:88)
   ...
   ...
   Caused by: org.apache.hudi.hive.HoodieHiveSyncException: Failed to sync 
partitions for table hudi_mysql_table2
        at 
org.apache.hudi.hive.HiveSyncTool.syncPartitions(HiveSyncTool.java:340)
        at 
org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:232)
        at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:153)
        at 
org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:141)
        ... 9 more
   Caused by: org.apache.hudi.hive.HoodieHiveSyncException: 
default.hudi_mysql_table2 add partition failed
        at 
org.apache.hudi.hive.ddl.HMSDDLExecutor.addPartitionsToTable(HMSDDLExecutor.java:209)
        at 
org.apache.hudi.hive.HoodieHiveSyncClient.addPartitionsToTable(HoodieHiveSyncClient.java:101)
        at 
org.apache.hudi.hive.HiveSyncTool.syncPartitions(HiveSyncTool.java:323)
        ... 12 more
   Caused by: MetaException(message:java.io.IOException: Got exception: 
java.io.IOException java.lang.NullPointerException)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result$add_partitions_req_resultStandardScheme.read(ThriftHiveMetastore.java)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result$add_partitions_req_resultStandardScheme.read(ThriftHiveMetastore.java)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$add_partitions_req_result.read(ThriftHiveMetastore.java)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:88)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_add_partitions_req(ThriftHiveMetastore.java:1911)
        at 
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.add_partitions_req(ThriftHiveMetastore.java:1898)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.add_partitions(HiveMetaStoreClient.java:625)
        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.$Proxy40.add_partitions(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:2327)
        at com.sun.proxy.$Proxy40.add_partitions(Unknown Source)
        at 
org.apache.hudi.hive.ddl.HMSDDLExecutor.addPartitionsToTable(HMSDDLExecutor.java:206)
        ... 14 more
   ```
   
   


-- 
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]

Reply via email to