wanglijie95 commented on a change in pull request #19152:
URL: https://github.com/apache/flink/pull/19152#discussion_r830881454



##########
File path: 
flink-end-to-end-tests/flink-tpcds-test/src/main/java/org/apache/flink/table/tpcds/TpcdsTestProgram.java
##########
@@ -109,16 +113,21 @@ public static void main(String[] args) throws Exception {
 
             // register sink table
             String sinkTableName = QUERY_PREFIX + queryId + "_sinkTable";
-            ((TableEnvironmentInternal) tableEnvironment)
-                    .registerTableSinkInternal(
-                            sinkTableName,
-                            new CsvTableSink(
-                                    sinkTablePath + FILE_SEPARATOR + queryId + 
RESULT_SUFFIX,
-                                    COL_DELIMITER,
-                                    1,
-                                    FileSystem.WriteMode.OVERWRITE,
-                                    resultTable.getSchema().getFieldNames(),
-                                    
resultTable.getSchema().getFieldDataTypes()));
+            tableEnvironment.createTable(
+                    sinkTableName,
+                    TableDescriptor.forConnector(FILE_CONNECTOR_NAME)
+                            .schema(resultTable.getSchema().toSchema())
+                            .format(
+                                    FormatDescriptor.forFormat(CSV_FORMAT)
+                                            
.option(CsvFormatOptions.FIELD_DELIMITER, COL_DELIMITER)
+                                            
.option(CsvFormatOptions.DISABLE_QUOTE_CHARACTER, true)
+                                            .build())
+                            .option(
+                                    FILE_PATH,
+                                    sinkTablePath + FILE_SEPARATOR + queryId + 
RESULT_SUFFIX)
+                            .option(SINK_PARALLELISM, CSV_SINK_PARALLELISM)
+                            .build());
+
             TableResult tableResult = resultTable.executeInsert(sinkTableName);

Review comment:
       In this place, maybe `executeInsert(sinkTableName, true)` should be used 
to align the behavior of the original `FileSystem.WriteMode.OVERWRITE`?




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