Jackie-Jiang commented on a change in pull request #5238: Evaluate schema
transform expressions during ingestion
URL: https://github.com/apache/incubator-pinot/pull/5238#discussion_r407678090
##########
File path:
pinot-spi/src/main/java/org/apache/pinot/spi/data/readers/RecordExtractor.java
##########
@@ -18,16 +18,28 @@
*/
package org.apache.pinot.spi.data.readers;
-import org.apache.pinot.spi.data.Schema;
+import java.util.List;
+
+/**
+ * Extracts fields from input records
+ * @param <T> The format of the input record
+ */
public interface RecordExtractor<T> {
+
+ /**
+ * Initialize the record extractor with its config
+ */
+ default void init(RecordExtractorConfig recordExtractorConfig) {
+ }
+
/**
- * TODO Add text to this javadoc
+ * Extracts fields as listed in the sourceFieldNames from the given input
record and sets them into the GenericRow
*
- * @param schema
- * @param from
- * @param to
- * @return
+ * @param sourceFieldNames List of field names to extract from the provided
input record
+ * @param from The input record
+ * @param to The output GenericRow
+ * @return The output GenericRow
*/
- GenericRow extract(Schema schema, T from, GenericRow to);
+ GenericRow extract(List<String> sourceFieldNames, T from, GenericRow to);
Review comment:
+1.
I would recommend putting source fields into the init:
```
void init(List<String> fields, @Nullable RecordExtractorConfig
recordExtractorConfig);
```
Same for RecrodReader, replace schema with the fields
----------------------------------------------------------------
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]