Skip to content

Commit 733c028

Browse files
authored
[INLONG-4050][sort] Fix parameter definition error of hive load
1 parent 6f8c649 commit 733c028

File tree

1 file changed

+9
-9
lines changed
  • inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load

1 file changed

+9
-9
lines changed

inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/HiveLoadNode.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.apache.inlong.sort.protocol.transformation.FilterFunction;
3333

3434
import javax.annotation.Nonnull;
35-
import javax.annotation.Nullable;
3635
import java.io.Serializable;
3736
import java.util.List;
3837
import java.util.Map;
@@ -62,7 +61,6 @@ public class HiveLoadNode extends LoadNode implements Serializable {
6261
private String database;
6362

6463
@JsonProperty("hiveConfDir")
65-
@Nonnull
6664
private String hiveConfDir;
6765

6866
@JsonProperty("hiveVersion")
@@ -81,20 +79,20 @@ public HiveLoadNode(@JsonProperty("id") String id,
8179
@JsonProperty("fields") List<FieldInfo> fields,
8280
@JsonProperty("fieldRelationShips") List<FieldRelationShip> fieldRelationShips,
8381
@JsonProperty("filters") List<FilterFunction> filters,
84-
@Nullable @JsonProperty("sinkParallelism") Integer sinkParallelism,
82+
@JsonProperty("sinkParallelism") Integer sinkParallelism,
8583
@JsonProperty("properties") Map<String, String> properties,
8684
@JsonProperty("catalogName") String catalogName,
87-
@Nullable @JsonProperty("database") String database,
88-
@Nullable @JsonProperty("tableName") String tableName,
89-
@Nullable @JsonProperty("hiveConfDir") String hiveConfDir,
90-
@Nullable @JsonProperty("hiveVersion") String hiveVersion,
85+
@JsonProperty("database") String database,
86+
@JsonProperty("tableName") String tableName,
87+
@JsonProperty("hiveConfDir") String hiveConfDir,
88+
@JsonProperty("hiveVersion") String hiveVersion,
9189
@JsonProperty("hadoopConfDir") String hadoopConfDir,
9290
@JsonProperty("parFields") List<FieldInfo> partitionFields) {
9391
super(id, name, fields, fieldRelationShips, filters, sinkParallelism, properties);
9492
this.database = Preconditions.checkNotNull(database, "database of hive is null");
9593
this.tableName = Preconditions.checkNotNull(tableName, "table of hive is null");
96-
this.hiveConfDir = Preconditions.checkNotNull(hiveConfDir, "hive config path is null");
9794
this.hiveVersion = Preconditions.checkNotNull(hiveVersion, "version of hive is null");
95+
this.hiveConfDir = hiveConfDir;
9896
this.catalogName = catalogName;
9997
this.hadoopConfDir = hadoopConfDir;
10098
this.partitionFields = partitionFields;
@@ -121,11 +119,13 @@ public Map<String, String> tableOptions() {
121119
Map<String, String> map = super.tableOptions();
122120
map.put("connector", "hive");
123121
map.put("default-database", database);
124-
map.put("hive-conf-dir", hiveConfDir);
125122
map.put("hive-version", hiveVersion);
126123
if (null != hadoopConfDir) {
127124
map.put("hadoop-conf-dir", hadoopConfDir);
128125
}
126+
if (null != hiveConfDir) {
127+
map.put("hive-conf-dir", hiveConfDir);
128+
}
129129
if (null != partitionFields) {
130130
Map<String, String> properties = super.getProperties();
131131
if (null == properties || !properties.containsKey(trigger)) {

0 commit comments

Comments
 (0)