You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/06/03 18:36:38 UTC

[GitHub] [incubator-pinot] kishoreg commented on a change in pull request #5484: Extract all fields if fieldsToRead is null/empty

kishoreg commented on a change in pull request #5484:
URL: https://github.com/apache/incubator-pinot/pull/5484#discussion_r434773777



##########
File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##########
@@ -39,10 +42,15 @@ public void init(Set<String> fields, @Nullable RecordExtractorConfig recordExtra
 
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
-    for (String fieldName : _fields) {
-      Object value = from.get(fieldName);
-      Object convertedValue = AvroUtils.convert(value);
-      to.putValue(fieldName, convertedValue);
+    if (_fields == null || _fields.isEmpty()) { // extract all

Review comment:
       update the javadoc for streamdecoder with the new contract

##########
File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##########
@@ -39,10 +42,15 @@ public void init(Set<String> fields, @Nullable RecordExtractorConfig recordExtra
 
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
-    for (String fieldName : _fields) {
-      Object value = from.get(fieldName);
-      Object convertedValue = AvroUtils.convert(value);
-      to.putValue(fieldName, convertedValue);
+    if (_fields == null || _fields.isEmpty()) { // extract all

Review comment:
       since we know this in the init, can we set a final boolean _extractAll? jvm might be able to optimize it.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org