[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6005: Fix extract method in AvroRecordExtractor class

2020-09-12 Thread GitBox


Jackie-Jiang commented on a change in pull request #6005:
URL: https://github.com/apache/incubator-pinot/pull/6005#discussion_r487213705



##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern

##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow 

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6005: Fix extract method in AvroRecordExtractor class

2020-09-12 Thread GitBox


Jackie-Jiang commented on a change in pull request #6005:
URL: https://github.com/apache/incubator-pinot/pull/6005#discussion_r487213705



##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern





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



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



[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6005: Fix extract method in AvroRecordExtractor class

2020-09-11 Thread GitBox


Jackie-Jiang commented on a change in pull request #6005:
URL: https://github.com/apache/incubator-pinot/pull/6005#discussion_r487213705



##
File path: 
pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroRecordExtractor.java
##
@@ -46,14 +46,13 @@ public void init(Set fields, @Nullable 
RecordExtractorConfig recordExtra
   @Override
   public GenericRow extract(GenericRecord from, GenericRow to) {
 if (_extractAll) {
-  Map jsonMap = JsonUtils.genericRecordToJson(from);
-  jsonMap.forEach((fieldName, value) -> to.putValue(fieldName, 
AvroUtils.convert(value)));
+  List fields = from.getSchema().getFields();

Review comment:
   Suggest using the non-functional way for performance concern





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



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