vlsi commented on a change in pull request #1703: [CALCITE-2450] Normalize
RexCall predicates when computing digest
URL: https://github.com/apache/calcite/pull/1703#discussion_r363023071
##########
File path:
core/src/main/java/org/apache/calcite/rel/externalize/RelJsonWriter.java
##########
@@ -140,6 +142,17 @@ public RelWriter done(RelNode node) {
public String asString() {
final Map<String, Object> map = jsonBuilder.map();
map.put("rels", relList);
- return jsonBuilder.toJsonString(map);
+ AtomicInteger skipNormalize = null;
+ if (getDetailLevel() != SqlExplainLevel.DIGEST_ATTRIBUTES) {
+ skipNormalize = RexNode.DESCRIBE_WITHOUT_NORMALIZE.get();
+ skipNormalize.incrementAndGet();
+ }
+ try {
Review comment:
I would consider that to be on the hot path (especially in RexCall), so I
would refrain from allocating extra objects there.
Adding a method like `withoutNormalize(Runnable)` won't make a huge
readability difference, yet it would add overhead. The API is not intended for
public use, so I'm inclined to leave it as is.
----------------------------------------------------------------
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