liangyu-1 opened a new issue, #6529:
URL: https://github.com/apache/hudi/issues/6529

   **_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**
   
   when I run the flink insert sql statement, I found the noclassfound 
exception, but I have added the jars under my $FLINK_LIB, there may be some 
conflicts of the jars, but I cannot figure this out.
   
   A clear and concise description of the problem.
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   I have put hudi-flink-client-0.11.1 jar and 
hudi-flink1.14-bundle_2.11-0.11.jar under the $FLINK_CONF_LIB
   and I maven I have procvide the dependency
   
               <dependency>
                   <groupId>org.apache.hudi</groupId>
                   <artifactId>hudi-flink-client</artifactId>
                   <version>0.11.1</version>
               </dependency>
   
               <dependency>
                   <groupId>org.apache.hudi</groupId>
                   <artifactId>hudi-flink1.14-bundle_2.11</artifactId>
                   <version>0.11.1</version>
               </dependency>
   
   then I use the flink sql with flink stream api together.
   here is my code:
   
   ` 
   
       val table = tableEnv.fromDataStream(dataStream, schema)
   
       val createCatalog =
         """
                          CREATE CATALOG hudi WITH(
                          'type' = 'hudi',
                          'catalog.path' = 'hdfs://path,
                          'default-database' = 'kx')
                          """
       val useCatalog = "use catalog hudi"
       val createTable =
         """
       CREATE TABLE if not exists flink_warehouse.stay_model_test_hdp (
         xx VARCHAR(20) PRIMARY KEY NOT ENFORCED,
         xx VARCHAR(30),
         xx VARCHAR(30)
       )
       WITH (
         'connector' = 'hudi',
       'path' = 'hdfs://path',
       'compaction.delta_commits' = '1',
       'compaction.async.enabled' = 'true',
       'compaction.trigger.strategy' = 'num_commits',
       'table.type' = 'COPY_ON_WRITE',
       'hive_sync.enable' = 'true',
       'hive_sync.mode' = 'hms',
       'hive_sync.metastore.uris' = 'thrift://x.x.x.x:9083',
       'hive_sync.table'='compaction_test',
       'hive_sync.db'='kx')
       """
   
       //    val insertSql =
       //      """
       //        |insert into flink_warehouse.compaction_test_hdp
       //        |select * from
       //        |input table
       //        |""".stripMargin
   
   
       tableEnv.executeSql(
         createCatalog)
       tableEnv.executeSql(
         useCatalog)
       tableEnv.executeSql(
         createTable)
       tableEnv.createStatementSet()
         .addInsert("flink_warehouse.stay_model_test_hdp", table)
         //    tableEnv.executeSql()
         .execute()
   
   `
   1.
   2.
   3.
   4.
   
   **Expected behavior**
   
   
   
   
   A clear and concise description of what you expected to happen.
   
   **Environment Description**
   
   * Hudi version : 0.11.1
   
   * Spark version :
   
   * Hive version : 3.1.0
   
   * Hadoop version :3.0.0
   
   * Storage (HDFS/S3/GCS..) : hadoop
   
   * Running on Docker? (yes/no) : no
   
   
   **Additional context**
   
   Add any other context about the problem here.
   
   **Stacktrace**
   
   ```2022-08-29 20:01:20,298 INFO  
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain [] - Could not 
complete snapshot 2 for operator stream_write: stay_model_test_hdp (3/4)#0. 
Failure reason: Checkpoint was declined.
   org.apache.flink.runtime.checkpoint.CheckpointException: Could not complete 
snapshot 2 for operator stream_write: stay_model_test_hdp (3/4)#0. Failure 
reason: Checkpoint was declined.
        at 
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.snapshotState(StreamOperatorStateHandler.java:265)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.snapshotState(StreamOperatorStateHandler.java:170)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.AbstractStreamOperator.snapshotState(AbstractStreamOperator.java:348)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.checkpointStreamOperator(RegularOperatorChain.java:233)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.buildOperatorSnapshotFutures(RegularOperatorChain.java:206)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.snapshotState(RegularOperatorChain.java:186)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.SubtaskCheckpointCoordinatorImpl.takeSnapshotSync(SubtaskCheckpointCoordinatorImpl.java:605)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.SubtaskCheckpointCoordinatorImpl.checkpointState(SubtaskCheckpointCoordinatorImpl.java:315)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$performCheckpoint$14(StreamTask.java:1329)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.runThrowing(StreamTaskActionExecutor.java:50)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.performCheckpoint(StreamTask.java:1315)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.triggerCheckpointOnBarrier(StreamTask.java:1258)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.CheckpointBarrierHandler.notifyCheckpoint(CheckpointBarrierHandler.java:147)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler.triggerCheckpoint(SingleCheckpointBarrierHandler.java:287)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler.access$100(SingleCheckpointBarrierHandler.java:64)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler$ControllerImpl.triggerGlobalCheckpoint(SingleCheckpointBarrierHandler.java:493)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.AbstractAlignedBarrierHandlerState.triggerGlobalCheckpoint(AbstractAlignedBarrierHandlerState.java:74)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.AbstractAlignedBarrierHandlerState.barrierReceived(AbstractAlignedBarrierHandlerState.java:66)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler.lambda$processBarrier$2(SingleCheckpointBarrierHandler.java:234)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler.markCheckpointAlignedAndTransformState(SingleCheckpointBarrierHandler.java:262)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.SingleCheckpointBarrierHandler.processBarrier(SingleCheckpointBarrierHandler.java:231)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.CheckpointedInputGate.handleEvent(CheckpointedInputGate.java:181)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.checkpointing.CheckpointedInputGate.pollNext(CheckpointedInputGate.java:159)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:110)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:496)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:203)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:809)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:761) 
~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:958)
 [flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:937) 
[flink-dist_2.11-1.14.5.jar:1.14.5]
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:766) 
[flink-dist_2.11-1.14.5.jar:1.14.5]
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:575) 
[flink-dist_2.11-1.14.5.jar:1.14.5]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
   Caused by: org.apache.hudi.exception.HoodieUpsertException: Failed to upsert 
for commit time 20220829195920995
        at 
org.apache.hudi.table.action.commit.FlinkWriteHelper.write(FlinkWriteHelper.java:80)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.action.commit.FlinkUpsertCommitActionExecutor.execute(FlinkUpsertCommitActionExecutor.java:49)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.HoodieFlinkCopyOnWriteTable.upsert(HoodieFlinkCopyOnWriteTable.java:116)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.client.HoodieFlinkWriteClient.upsert(HoodieFlinkWriteClient.java:143)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.lambda$initWriteFunction$1(StreamWriteFunction.java:184)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.lambda$flushRemaining$7(StreamWriteFunction.java:461)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) 
~[?:1.8.0_171]
        at 
org.apache.hudi.sink.StreamWriteFunction.flushRemaining(StreamWriteFunction.java:454)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.snapshotState(StreamWriteFunction.java:131)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.common.AbstractStreamWriteFunction.snapshotState(AbstractStreamWriteFunction.java:157)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.trySnapshotFunctionState(StreamingFunctionUtils.java:118)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.snapshotFunctionState(StreamingFunctionUtils.java:99)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.snapshotState(AbstractUdfStreamOperator.java:87)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.snapshotState(StreamOperatorStateHandler.java:219)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        ... 33 more
   Caused by: java.lang.NoSuchMethodError: 
org.apache.hudi.execution.FlinkLazyInsertIterable.getTransformFunction(Lorg/apache/avro/Schema;Lorg/apache/hudi/config/HoodieWriteConfig;)Ljava/util/function/Function;
        at 
org.apache.hudi.execution.FlinkLazyInsertIterable.computeNext(FlinkLazyInsertIterable.java:60)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.execution.FlinkLazyInsertIterable.computeNext(FlinkLazyInsertIterable.java:39)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.client.utils.LazyIterableIterator.next(LazyIterableIterator.java:119)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_171]
        at 
org.apache.hudi.table.action.commit.BaseFlinkCommitActionExecutor.execute(BaseFlinkCommitActionExecutor.java:114)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.action.commit.BaseFlinkCommitActionExecutor.execute(BaseFlinkCommitActionExecutor.java:70)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.action.commit.FlinkWriteHelper.write(FlinkWriteHelper.java:73)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.action.commit.FlinkUpsertCommitActionExecutor.execute(FlinkUpsertCommitActionExecutor.java:49)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.table.HoodieFlinkCopyOnWriteTable.upsert(HoodieFlinkCopyOnWriteTable.java:116)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.client.HoodieFlinkWriteClient.upsert(HoodieFlinkWriteClient.java:143)
 ~[hudi-flink-client-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.lambda$initWriteFunction$1(StreamWriteFunction.java:184)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.lambda$flushRemaining$7(StreamWriteFunction.java:461)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) 
~[?:1.8.0_171]
        at 
org.apache.hudi.sink.StreamWriteFunction.flushRemaining(StreamWriteFunction.java:454)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.StreamWriteFunction.snapshotState(StreamWriteFunction.java:131)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.hudi.sink.common.AbstractStreamWriteFunction.snapshotState(AbstractStreamWriteFunction.java:157)
 ~[hudi-flink1.14-bundle_2.11-0.11.1.jar:0.11.1]
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.trySnapshotFunctionState(StreamingFunctionUtils.java:118)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.util.functions.StreamingFunctionUtils.snapshotFunctionState(StreamingFunctionUtils.java:99)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.snapshotState(AbstractUdfStreamOperator.java:87)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        at 
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.snapshotState(StreamOperatorStateHandler.java:219)
 ~[flink-dist_2.11-1.14.5.jar:1.14.5]
        ... 33 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