You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/11/08 20:07:06 UTC

[GitHub] leventov commented on a change in pull request #6590: optimize input row parsers

leventov commented on a change in pull request #6590: optimize input row parsers
URL: https://github.com/apache/incubator-druid/pull/6590#discussion_r232043335
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/data/input/impl/MapInputRowParser.java
 ##########
 @@ -36,20 +36,22 @@
 public class MapInputRowParser implements InputRowParser<Map<String, Object>>
 {
   private final ParseSpec parseSpec;
+  private final List<String> dimensions;
 
   @JsonCreator
   public MapInputRowParser(
       @JsonProperty("parseSpec") ParseSpec parseSpec
   )
   {
     this.parseSpec = parseSpec;
+    this.dimensions = parseSpec.getDimensionsSpec().getDimensionNames();
   }
 
   @Override
   public List<InputRow> parseBatch(Map<String, Object> theMap)
   {
-    final List<String> dimensions = parseSpec.getDimensionsSpec().hasCustomDimensions()
-                                    ? parseSpec.getDimensionsSpec().getDimensionNames()
+    final List<String> dimensions = !this.dimensions.isEmpty()
 
 Review comment:
   Please use if-else instead of multiline ternary. In other places too.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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