npawar commented on a change in pull request #6046:
URL: https://github.com/apache/incubator-pinot/pull/6046#discussion_r504138810
##########
File path:
pinot-plugins/pinot-input-format/pinot-csv/src/main/java/org/apache/pinot/plugin/inputformat/csv/CSVRecordReader.java
##########
@@ -95,8 +95,13 @@ public void init(File dataFile, Set<String> fieldsToRead,
@Nullable RecordReader
_recordExtractor = new CSVRecordExtractor();
CSVRecordExtractorConfig recordExtractorConfig = new
CSVRecordExtractorConfig();
recordExtractorConfig.setMultiValueDelimiter(multiValueDelimiter);
- _recordExtractor.init(fieldsToRead, recordExtractorConfig);
+
init();
+
+ if (fieldsToRead == null || fieldsToRead.isEmpty()) {
Review comment:
I prefer the alternate implementation. Reason being, the RecordExtractor
is a public API. They could be used in external applications. The external
users should not have to know that all except CSVRecordExtractor expect
fieldsToRead upfront.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]