32
32
import org .apache .inlong .sort .protocol .transformation .FilterFunction ;
33
33
34
34
import javax .annotation .Nonnull ;
35
- import javax .annotation .Nullable ;
36
35
import java .io .Serializable ;
37
36
import java .util .List ;
38
37
import java .util .Map ;
@@ -62,7 +61,6 @@ public class HiveLoadNode extends LoadNode implements Serializable {
62
61
private String database ;
63
62
64
63
@ JsonProperty ("hiveConfDir" )
65
- @ Nonnull
66
64
private String hiveConfDir ;
67
65
68
66
@ JsonProperty ("hiveVersion" )
@@ -81,20 +79,20 @@ public HiveLoadNode(@JsonProperty("id") String id,
81
79
@ JsonProperty ("fields" ) List <FieldInfo > fields ,
82
80
@ JsonProperty ("fieldRelationShips" ) List <FieldRelationShip > fieldRelationShips ,
83
81
@ JsonProperty ("filters" ) List <FilterFunction > filters ,
84
- @ Nullable @ JsonProperty ("sinkParallelism" ) Integer sinkParallelism ,
82
+ @ JsonProperty ("sinkParallelism" ) Integer sinkParallelism ,
85
83
@ JsonProperty ("properties" ) Map <String , String > properties ,
86
84
@ 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 ,
91
89
@ JsonProperty ("hadoopConfDir" ) String hadoopConfDir ,
92
90
@ JsonProperty ("parFields" ) List <FieldInfo > partitionFields ) {
93
91
super (id , name , fields , fieldRelationShips , filters , sinkParallelism , properties );
94
92
this .database = Preconditions .checkNotNull (database , "database of hive is null" );
95
93
this .tableName = Preconditions .checkNotNull (tableName , "table of hive is null" );
96
- this .hiveConfDir = Preconditions .checkNotNull (hiveConfDir , "hive config path is null" );
97
94
this .hiveVersion = Preconditions .checkNotNull (hiveVersion , "version of hive is null" );
95
+ this .hiveConfDir = hiveConfDir ;
98
96
this .catalogName = catalogName ;
99
97
this .hadoopConfDir = hadoopConfDir ;
100
98
this .partitionFields = partitionFields ;
@@ -121,11 +119,13 @@ public Map<String, String> tableOptions() {
121
119
Map <String , String > map = super .tableOptions ();
122
120
map .put ("connector" , "hive" );
123
121
map .put ("default-database" , database );
124
- map .put ("hive-conf-dir" , hiveConfDir );
125
122
map .put ("hive-version" , hiveVersion );
126
123
if (null != hadoopConfDir ) {
127
124
map .put ("hadoop-conf-dir" , hadoopConfDir );
128
125
}
126
+ if (null != hiveConfDir ) {
127
+ map .put ("hive-conf-dir" , hiveConfDir );
128
+ }
129
129
if (null != partitionFields ) {
130
130
Map <String , String > properties = super .getProperties ();
131
131
if (null == properties || !properties .containsKey (trigger )) {
0 commit comments