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

[incubator-inlong] branch master updated: [INLONG-4050][sort] Fix parameter definition error of hive load

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

zirui 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 733c0289a [INLONG-4050][sort] Fix parameter definition error of hive load
733c0289a is described below

commit 733c0289a55c806ad96903a8a525dbac324381a1
Author: ganfengtan <Ga...@users.noreply.github.com>
AuthorDate: Sun May 1 10:00:02 2022 +0800

    [INLONG-4050][sort] Fix parameter definition error of hive load
---
 .../inlong/sort/protocol/node/load/HiveLoadNode.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 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 c38969c57..d4f114f89 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
@@ -32,7 +32,6 @@ import org.apache.inlong.sort.protocol.transformation.FieldRelationShip;
 import org.apache.inlong.sort.protocol.transformation.FilterFunction;
 
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
@@ -62,7 +61,6 @@ public class HiveLoadNode extends LoadNode implements Serializable {
     private String database;
 
     @JsonProperty("hiveConfDir")
-    @Nonnull
     private String hiveConfDir;
 
     @JsonProperty("hiveVersion")
@@ -81,20 +79,20 @@ public class HiveLoadNode extends LoadNode implements Serializable {
             @JsonProperty("fields") List<FieldInfo> fields,
             @JsonProperty("fieldRelationShips") List<FieldRelationShip> fieldRelationShips,
             @JsonProperty("filters") List<FilterFunction> filters,
-            @Nullable @JsonProperty("sinkParallelism") Integer sinkParallelism,
+            @JsonProperty("sinkParallelism") Integer sinkParallelism,
             @JsonProperty("properties") Map<String, String> properties,
             @JsonProperty("catalogName") String catalogName,
-            @Nullable @JsonProperty("database") String database,
-            @Nullable @JsonProperty("tableName") String tableName,
-            @Nullable @JsonProperty("hiveConfDir") String hiveConfDir,
-            @Nullable @JsonProperty("hiveVersion") String hiveVersion,
+            @JsonProperty("database") String database,
+            @JsonProperty("tableName") String tableName,
+            @JsonProperty("hiveConfDir") String hiveConfDir,
+            @JsonProperty("hiveVersion") String hiveVersion,
             @JsonProperty("hadoopConfDir") String hadoopConfDir,
             @JsonProperty("parFields") List<FieldInfo> partitionFields) {
         super(id, name, fields, fieldRelationShips, filters, sinkParallelism, properties);
         this.database = Preconditions.checkNotNull(database, "database of hive is null");
         this.tableName = Preconditions.checkNotNull(tableName, "table of hive is null");
-        this.hiveConfDir = Preconditions.checkNotNull(hiveConfDir, "hive config path is null");
         this.hiveVersion = Preconditions.checkNotNull(hiveVersion, "version of hive is null");
+        this.hiveConfDir = hiveConfDir;
         this.catalogName = catalogName;
         this.hadoopConfDir = hadoopConfDir;
         this.partitionFields = partitionFields;
@@ -121,11 +119,13 @@ 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-conf-dir", hiveConfDir);
         map.put("hive-version", hiveVersion);
         if (null != hadoopConfDir) {
             map.put("hadoop-conf-dir", hadoopConfDir);
         }
+        if (null != hiveConfDir) {
+            map.put("hive-conf-dir", hiveConfDir);
+        }
         if (null != partitionFields) {
             Map<String, String> properties = super.getProperties();
             if (null == properties || !properties.containsKey(trigger)) {