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 c38969c5764..d4f114f8962 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.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 HiveLoadNode(@JsonProperty("id") String id, @JsonProperty("fields") List fields, @JsonProperty("fieldRelationShips") List fieldRelationShips, @JsonProperty("filters") List filters, - @Nullable @JsonProperty("sinkParallelism") Integer sinkParallelism, + @JsonProperty("sinkParallelism") Integer sinkParallelism, @JsonProperty("properties") Map 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 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 Map tableOptions() { Map 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 properties = super.getProperties(); if (null == properties || !properties.containsKey(trigger)) {