TaoZex commented on code in PR #3375:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3375#discussion_r1020674424


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.common.utils.DateTimeUtils;
+import org.apache.seatunnel.common.utils.DateUtils;
+import org.apache.seatunnel.common.utils.TimeUtils;
+
+import java.util.List;
+
+public class BaseSinkConfig {
+    public static final String SEATUNNEL = "seatunnel";
+    public static final String NON_PARTITION = "NON_PARTITION";
+    public static final String TRANSACTION_ID_SPLIT = "_";
+    public static final String TRANSACTION_EXPRESSION = "transactionId";
+    public static final Option<String> COMPRESS_CODEC = 
Options.key("compress_codec")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("Compression codec");
+    public static final Option<DateUtils.Formatter> DATE_FORMAT = 
Options.key("date_format")
+            .enumType(DateUtils.Formatter.class)
+            .defaultValue(DateUtils.Formatter.YYYY_MM_DD)
+            .withDescription("Date format");
+    public static final Option<DateTimeUtils.Formatter> DATETIME_FORMAT = 
Options.key("datetime_format")
+            .enumType(DateTimeUtils.Formatter.class)
+            .defaultValue(DateTimeUtils.Formatter.YYYY_MM_DD_HH_MM_SS)
+            .withDescription("Datetime format");
+    public static final Option<TimeUtils.Formatter> TIME_FORMAT = 
Options.key("time_format")
+            .enumType(TimeUtils.Formatter.class)
+            .defaultValue(TimeUtils.Formatter.HH_MM_SS)
+            .withDescription("Time format");
+    public static final Option<String> FILE_PATH = Options.key("path")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The file path of target files");
+    public static final Option<String> FIELD_DELIMITER = 
Options.key("field_delimiter")
+            .stringType()
+            .defaultValue(String.valueOf(String.valueOf('\001')))
+            .withDescription("The separator between columns in a row of data. 
Only needed by `text` and `csv` file format");
+    public static final Option<String> ROW_DELIMITER = 
Options.key("row_delimiter")
+            .stringType()
+            .defaultValue("\n")
+            .withDescription("The separator between rows in a file. Only 
needed by `text` and `csv` file format");
+    public static final Option<List<String>> PARTITION_BY = 
Options.key("partition_by")
+            .listType()
+            .noDefaultValue()
+            .withDescription("Partition keys list");
+    public static final Option<String> PARTITION_DIR_EXPRESSION = 
Options.key("partition_dir_expression")
+            .stringType()
+            .defaultValue("${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/")
+            .withDescription("If the `partition_by` is specified, " +
+                    "we will generate the corresponding partition directory 
based on the partition information, " +
+                    "and the final file will be placed in the partition 
directory. " +
+                    "Default `partition_dir_expression` is 
`${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/`. " +
+                    "`k0` is the first partition field and `v0` is the value 
of the first partition field.");
+    public static final Option<Boolean> IS_PARTITION_FIELD_WRITE_IN_FILE = 
Options.key("is_partition_field_write_in_file")
+            .booleanType()
+            .defaultValue(false)
+            .withDescription("Whether to write partition fields to file");
+    public static final Option<String> TMP_PATH = Options.key("tmp_path")
+            .stringType()
+            .defaultValue("/tmp/seatunnel")

Review Comment:
   Same as above.



##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.file.config;
+
+import org.apache.seatunnel.api.configuration.Option;
+import org.apache.seatunnel.api.configuration.Options;
+import org.apache.seatunnel.common.utils.DateTimeUtils;
+import org.apache.seatunnel.common.utils.DateUtils;
+import org.apache.seatunnel.common.utils.TimeUtils;
+
+import java.util.List;
+
+public class BaseSinkConfig {
+    public static final String SEATUNNEL = "seatunnel";
+    public static final String NON_PARTITION = "NON_PARTITION";
+    public static final String TRANSACTION_ID_SPLIT = "_";
+    public static final String TRANSACTION_EXPRESSION = "transactionId";
+    public static final Option<String> COMPRESS_CODEC = 
Options.key("compress_codec")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("Compression codec");
+    public static final Option<DateUtils.Formatter> DATE_FORMAT = 
Options.key("date_format")
+            .enumType(DateUtils.Formatter.class)
+            .defaultValue(DateUtils.Formatter.YYYY_MM_DD)
+            .withDescription("Date format");
+    public static final Option<DateTimeUtils.Formatter> DATETIME_FORMAT = 
Options.key("datetime_format")
+            .enumType(DateTimeUtils.Formatter.class)
+            .defaultValue(DateTimeUtils.Formatter.YYYY_MM_DD_HH_MM_SS)
+            .withDescription("Datetime format");
+    public static final Option<TimeUtils.Formatter> TIME_FORMAT = 
Options.key("time_format")
+            .enumType(TimeUtils.Formatter.class)
+            .defaultValue(TimeUtils.Formatter.HH_MM_SS)
+            .withDescription("Time format");
+    public static final Option<String> FILE_PATH = Options.key("path")
+            .stringType()
+            .noDefaultValue()
+            .withDescription("The file path of target files");
+    public static final Option<String> FIELD_DELIMITER = 
Options.key("field_delimiter")
+            .stringType()
+            .defaultValue(String.valueOf(String.valueOf('\001')))
+            .withDescription("The separator between columns in a row of data. 
Only needed by `text` and `csv` file format");
+    public static final Option<String> ROW_DELIMITER = 
Options.key("row_delimiter")
+            .stringType()
+            .defaultValue("\n")

Review Comment:
   How about defining a constant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to