fx19880617 commented on a change in pull request #4888: Refactor file format 
based RecordReader constructors
URL: https://github.com/apache/incubator-pinot/pull/4888#discussion_r354718589
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/segment/creator/impl/SegmentIndexCreationDriverImpl.java
 ##########
 @@ -105,7 +106,45 @@
   @Override
   public void init(SegmentGeneratorConfig config)
       throws Exception {
-    init(config, RecordReaderFactory.getRecordReader(config));
+    init(config, getRecordReader(config));
+  }
+
+  private RecordReader getRecordReader(SegmentGeneratorConfig 
segmentGeneratorConfig)
+      throws Exception {
+    File dataFile = new File(segmentGeneratorConfig.getInputFilePath());
+    Preconditions.checkState(dataFile.exists(), "Input file: " + 
dataFile.getAbsolutePath() + " does not exist");
+
+    Schema schema = segmentGeneratorConfig.getSchema();
+    FileFormat fileFormat = segmentGeneratorConfig.getFormat();
+    String recordReaderPath = segmentGeneratorConfig.getRecordReaderPath();
+
+    // Allow for instantiation general record readers from a record reader 
path passed into segment generator config
+    // If this is set, this will override the file format
+    if (recordReaderPath != null) {
+      if (fileFormat != FileFormat.OTHER) {
+        // NOTE: we currently have default file format set to AVRO inside 
segment generator config, do not want to break
+        // this behavior for clients.
+        LOGGER
 
 Review comment:
   I don't want to change the old behavior, so keep it the same way.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to