使用Flink压缩HUDI引发NullPointerException:值不能为空

k4ymrczo  于 2023-04-27  发布在  Apache
关注(0)|答案(1)|浏览(309)

我遵循了Hudi网站上的示例,没有使用hudi-flink-bundle_2.11-0.9.0-SNAPSHOT.jar,而是使用从here获取的hudi-flink1.16-bundle-0.13.0.jar
命令:

$FLINK_HOME/bin/flink run \
  -c org.apache.hudi.sink.compact.HoodieFlinkCompactor \
  $FLINK_HOME/lib/hudi-flink1.16-bundle-0.13.0.jar \
  --path 'file://...sample_db/people'

异常跟踪:

The program finished with the following exception:

org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Value must not be null.
        at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:372)
        at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222)
        at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:98)
        at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:843)
        at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:240)
        at org.apache.flink.client.cli.CliFrontend.parseAndRun(CliFrontend.java:1087)
        at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1165)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1878)
        at org.apache.flink.runtime.security.contexts.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
        at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1165)
Caused by: java.lang.NullPointerException: Value must not be null.
        at org.apache.flink.configuration.Configuration.setValueInternal(Configuration.java:775)
        at org.apache.flink.configuration.Configuration.setValueInternal(Configuration.java:787)
        at org.apache.flink.configuration.Configuration.setString(Configuration.java:200)
        at org.apache.hudi.util.CompactionUtil.setPreCombineField(CompactionUtil.java:133)
        at org.apache.hudi.sink.compact.HoodieFlinkCompactor$AsyncCompactionService.<init>(HoodieFlinkCompactor.java:177)
        at org.apache.hudi.sink.compact.HoodieFlinkCompactor.main(HoodieFlinkCompactor.java:75)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)

有没有人也遇到过这样的情况,根本原因是什么呢?

cx6n0qe3

cx6n0qe31#

你确定你的表是莫尔,而不是COW,根据setPreCombineField()的Javadoc:

/**
   * Sets up the preCombine field into the given configuration {@code conf}
   * through reading from the hoodie table metadata.
   * <p>
   * This value is non-null as compaction can only be performed on MOR tables.
   * Of which, MOR tables will have non-null precombine fields.

相关问题