clintropolis commented on a change in pull request #9982:
URL: https://github.com/apache/druid/pull/9982#discussion_r437756683



##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/rel/QueryMaker.java
##########
@@ -126,7 +126,7 @@ public ObjectMapper getJsonMapper()
     return DataSourceAnalysis.forDataSource(query.getDataSource())
                              .getBaseQuerySegmentSpec()
                              .map(QuerySegmentSpec::getIntervals)
-                             .orElse(query.getIntervals());
+                             .orElseGet(query::getIntervals);

Review comment:
       btw, I made the changes here after I made the mistake of not using 
`orElseGet` in `ReferenceCountingSegmentQueryRunner` and funny side-effects 
were happening causing integration tests to fail, so I looked for other usages 
of `orElse` and switched the ones that were not returning a primitive or static 
value to use `orElseGet`, of which there were only these 2 I think.




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



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

Reply via email to