You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/05/25 08:05:07 UTC

[incubator-inlong] branch master updated: [INLONG-4371][Sort] Remove null constraint on hiveVersion, add hiveConfDir constraint (#4375)

This is an automated email from the ASF dual-hosted git repository.

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 485ddf3de [INLONG-4371][Sort] Remove null constraint on hiveVersion, add hiveConfDir constraint (#4375)
485ddf3de is described below

commit 485ddf3de9b296b22b48b61d112b8feb5a1d4652
Author: Schnapps <zp...@connect.ust.hk>
AuthorDate: Wed May 25 16:05:01 2022 +0800

    [INLONG-4371][Sort] Remove null constraint on hiveVersion, add hiveConfDir constraint (#4375)
---
 .../apache/inlong/sort/protocol/node/load/HiveLoadNode.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
index 4efaa0abc..90e3be5c6 100644
--- a/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
+++ b/inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java
@@ -64,11 +64,13 @@ public class HiveLoadNode extends LoadNode implements Serializable {
     @Nonnull
     private String database;
 
+    /**
+     * hive conf directory in which contains hive-site.xml(vital)
+     */
     @JsonProperty("hiveConfDir")
     private String hiveConfDir;
 
     @JsonProperty("hiveVersion")
-    @Nonnull
     private String hiveVersion;
 
     @JsonProperty("hadoopConfDir")
@@ -96,8 +98,8 @@ public class HiveLoadNode extends LoadNode implements Serializable {
         super(id, name, fields, fieldRelationShips, filters, filterStrategy, sinkParallelism, properties);
         this.database = Preconditions.checkNotNull(database, "database of hive is null");
         this.tableName = Preconditions.checkNotNull(tableName, "table of hive is null");
-        this.hiveVersion = Preconditions.checkNotNull(hiveVersion, "version of hive is null");
-        this.hiveConfDir = hiveConfDir;
+        this.hiveConfDir = Preconditions.checkNotNull(hiveConfDir, "hive conf directory is null");
+        this.hiveVersion = hiveVersion;
         this.catalogName = catalogName;
         this.hadoopConfDir = hadoopConfDir;
         this.partitionFields = partitionFields;
@@ -124,7 +126,9 @@ public class HiveLoadNode extends LoadNode implements Serializable {
         Map<String, String> map = super.tableOptions();
         map.put("connector", "hive");
         map.put("default-database", database);
-        map.put("hive-version", hiveVersion);
+        if (null != hiveVersion) {
+            map.put("hive-version", hiveVersion);
+        }
         if (null != hadoopConfDir) {
             map.put("hadoop-conf-dir", hadoopConfDir);
         }