You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/06/12 03:59:25 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #8933: [HUDI-5329] Spark reads table error when Flink creates table without precombine.field

danny0405 commented on code in PR #8933:
URL: https://github.com/apache/hudi/pull/8933#discussion_r1226058598


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/StreamerUtil.java:
##########
@@ -478,4 +481,36 @@ public static boolean isWriteCommit(HoodieTableType tableType, HoodieInstant ins
   public static String getAuxiliaryPath(Configuration conf) {
     return conf.getString(FlinkOptions.PATH) + Path.SEPARATOR + AUXILIARYFOLDER_NAME;
   }
+
+  /**
+   * Check the {@link FlinkOptions#PRECOMBINE_FIELD} of configuration.
+   *
+   * @param conf   The flink configuration.
+   * @param schema The table schema.
+   */
+  public static void checkPreCombineField(Configuration conf, ResolvedSchema schema) {
+    checkPreCombineField(conf, schema.getColumnNames());
+  }
+
+  /**
+   * Check the {@link FlinkOptions#PRECOMBINE_FIELD} of configuration.
+   *
+   * @param conf        The flink configuration.
+   * @param columnNames The column names.
+   */
+  public static void checkPreCombineField(Configuration conf, List<String> columnNames) {
+    String preCombineField = conf.get(FlinkOptions.PRECOMBINE_FIELD);
+    if (!columnNames.contains(preCombineField)) {

Review Comment:
   Does it still throw after spark pkless support: https://github.com/apache/hudi/pull/8107



-- 
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: commits-unsubscribe@hudi.apache.org

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