Vishal-Kamlapure commented on code in PR #28594:
URL: https://github.com/apache/flink/pull/28594#discussion_r3566152166


##########
flink-formats/flink-csv/src/main/java/org/apache/flink/formats/csv/CsvFileFormatFactory.java:
##########
@@ -130,7 +134,11 @@ public BulkFormat<RowData, FileSourceSplit> 
createRuntimeDecoder(
             final RowType projectedRowType = (RowType) 
projectedDataType.getLogicalType();
 
             final RowType physicalRowType = (RowType) 
physicalDataType.getLogicalType();
-            final CsvSchema schema = buildCsvSchema(physicalRowType, 
formatOptions);
+            CsvSchema builtSchema = buildCsvSchema(physicalRowType, 
formatOptions);
+            if (formatOptions.get(IGNORE_FIRST_LINE)) {
+                builtSchema = 
builtSchema.rebuild().setSkipFirstDataRow(true).build();

Review Comment:
   Thanks for the suggestion! I took another look at the implementation, and 
you're right that the schema can be configured correctly during construction. 
I've moved the option into buildCsvSchema() and removed the additional 
rebuild() step.



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