liunaijie commented on code in PR #6842:
URL: https://github.com/apache/seatunnel/pull/6842#discussion_r1607753650


##########
seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSink.java:
##########
@@ -232,18 +165,85 @@ private HadoopConf createHadoopConf(ReadonlyConfig 
readonlyConfig) {
         return hadoopConf;
     }
 
-    private Table getTableInformation() {
-        if (tableInformation == null) {
-            tableInformation = HiveTableUtils.getTableInfo(readonlyConfig);
+    private FileSinkConfig generateFileSinkConfig(ReadonlyConfig 
readonlyConfig) {
+        HiveTable tableInformation = getHiveTable();
+        CatalogTable hiveTable = tableInformation.getCatalogTable();
+        Config pluginConfig = readonlyConfig.toConfig();
+        List<String> sinkFields =
+                hiveTable.getTableSchema().getColumns().stream()
+                        .map(Column::getName)
+                        .collect(Collectors.toList());
+        switch (tableInformation.getInputFormat()) {
+            case TEXT:
+                Map<String, String> parameters = 
tableInformation.getTableParameters();
+                pluginConfig =
+                        pluginConfig
+                                .withValue(
+                                        FILE_FORMAT_TYPE.key(),
+                                        
ConfigValueFactory.fromAnyRef(FileFormat.TEXT.toString()))
+                                .withValue(
+                                        FIELD_DELIMITER.key(),
+                                        ConfigValueFactory.fromAnyRef(
+                                                parameters.get("field.delim")))

Review Comment:
   this line will has issue if the field.delim is `\t`, the 
`ConfigValueFactory.fromAnyRef` with replace it to `\\t`. then the writted data 
will has issue.



-- 
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