23
23
import org .apache .seatunnel .api .sink .SaveModePlaceHolder ;
24
24
import org .apache .seatunnel .api .sink .SchemaSaveMode ;
25
25
26
- import java .time .ZoneId ;
27
- import java .util .Collections ;
28
- import java .util .List ;
29
- import java .util .Map ;
30
-
31
- public class ClickhouseConfig {
26
+ public class ClickhouseSinkOptions {
32
27
33
28
/** Bulk size of clickhouse jdbc */
34
29
public static final Option <Integer > BULK_SIZE =
@@ -37,56 +32,13 @@ public class ClickhouseConfig {
37
32
.defaultValue (20000 )
38
33
.withDescription ("Bulk size of clickhouse jdbc" );
39
34
40
- public static final Option <String > SQL =
41
- Options .key ("sql" )
42
- .stringType ()
43
- .noDefaultValue ()
44
- .withDescription ("Clickhouse sql used to query data" );
45
-
46
- /** Clickhouse server host */
47
- public static final Option <String > HOST =
48
- Options .key ("host" )
49
- .stringType ()
50
- .noDefaultValue ()
51
- .withDescription ("Clickhouse server host" );
52
-
53
35
/** Clickhouse table name */
54
36
public static final Option <String > TABLE =
55
37
Options .key ("table" )
56
38
.stringType ()
57
39
.noDefaultValue ()
58
40
.withDescription ("Clickhouse table name" );
59
41
60
- /** Clickhouse database name */
61
- public static final Option <String > DATABASE =
62
- Options .key ("database" )
63
- .stringType ()
64
- .noDefaultValue ()
65
- .withDescription ("Clickhouse database name" );
66
-
67
- /** Clickhouse server username */
68
- public static final Option <String > USERNAME =
69
- Options .key ("username" )
70
- .stringType ()
71
- .noDefaultValue ()
72
- .withDescription ("Clickhouse server username" );
73
-
74
- /** Clickhouse server password */
75
- public static final Option <String > PASSWORD =
76
- Options .key ("password" )
77
- .stringType ()
78
- .noDefaultValue ()
79
- .withDescription ("Clickhouse server password" );
80
-
81
- /** Clickhouse server timezone */
82
- public static final Option <String > SERVER_TIME_ZONE =
83
- Options .key ("server_time_zone" )
84
- .stringType ()
85
- .defaultValue (ZoneId .systemDefault ().getId ())
86
- .withDescription (
87
- "The session time zone in database server."
88
- + "If not set, then ZoneId.systemDefault() is used to determine the server time zone" );
89
-
90
42
/** Split mode when table is distributed engine */
91
43
public static final Option <Boolean > SPLIT_MODE =
92
44
Options .key ("split_mode" )
@@ -121,72 +73,6 @@ public class ClickhouseConfig {
121
73
.withDescription (
122
74
"Allow experimental lightweight delete based on `*MergeTree` table engine" );
123
75
124
- /** ClickhouseFile sink connector used clickhouse-local program's path */
125
- public static final Option <String > CLICKHOUSE_LOCAL_PATH =
126
- Options .key ("clickhouse_local_path" )
127
- .stringType ()
128
- .noDefaultValue ()
129
- .withDescription (
130
- "ClickhouseFile sink connector used clickhouse-local program's path" );
131
-
132
- /** The method of copy Clickhouse file */
133
- public static final Option <ClickhouseFileCopyMethod > COPY_METHOD =
134
- Options .key ("copy_method" )
135
- .enumType (ClickhouseFileCopyMethod .class )
136
- .defaultValue (ClickhouseFileCopyMethod .SCP )
137
- .withDescription ("The method of copy Clickhouse file" );
138
-
139
- public static final Option <Boolean > COMPATIBLE_MODE =
140
- Options .key ("compatible_mode" )
141
- .booleanType ()
142
- .defaultValue (false )
143
- .withDescription (
144
- "In the lower version of Clickhouse, the ClickhouseLocal program does not support the `--path` parameter, "
145
- + "you need to use this mode to take other ways to realize the --path parameter function" );
146
-
147
- public static final String NODE_ADDRESS = "node_address" ;
148
-
149
- public static final Option <Boolean > NODE_FREE_PASSWORD =
150
- Options .key ("node_free_password" )
151
- .booleanType ()
152
- .defaultValue (false )
153
- .withDescription (
154
- "Because seatunnel need to use scp or rsync for file transfer, "
155
- + "seatunnel need clickhouse server-side access. If each spark node and clickhouse server are configured with password-free login, "
156
- + "you can configure this option to true, otherwise you need to configure the corresponding node password in the node_pass configuration" );
157
- /** The password of Clickhouse server node */
158
- public static final Option <List <NodePassConfig >> NODE_PASS =
159
- Options .key ("node_pass" )
160
- .listType (NodePassConfig .class )
161
- .noDefaultValue ()
162
- .withDescription ("The password of Clickhouse server node" );
163
-
164
- public static final Option <Map <String , String >> CLICKHOUSE_CONFIG =
165
- Options .key ("clickhouse.config" )
166
- .mapType ()
167
- .defaultValue (Collections .emptyMap ())
168
- .withDescription ("Clickhouse custom config" );
169
-
170
- public static final Option <String > KEY_PATH =
171
- Options .key ("key_path" )
172
- .stringType ()
173
- .noDefaultValue ()
174
- .withDescription ("The path of rsync/ssh key file" );
175
-
176
- public static final Option <String > FILE_FIELDS_DELIMITER =
177
- Options .key ("file_fields_delimiter" )
178
- .stringType ()
179
- .defaultValue ("\t " )
180
- .withDescription (
181
- "ClickhouseFile uses csv format to temporarily save data. If the data in the row contains the delimiter value of csv,"
182
- + " it may cause program exceptions. Avoid this with this configuration. Value string has to be an exactly one character long" );
183
-
184
- public static final Option <String > FILE_TEMP_PATH =
185
- Options .key ("file_temp_path" )
186
- .stringType ()
187
- .defaultValue ("/tmp/seatunnel/clickhouse-local/file" )
188
- .withDescription (
189
- "The directory where ClickhouseFile stores temporary files locally." );
190
76
public static final Option <SchemaSaveMode > SCHEMA_SAVE_MODE =
191
77
Options .key ("schema_save_mode" )
192
78
.enumType (SchemaSaveMode .class )
0 commit comments