soumyakanti3578 commented on code in PR #5196:
URL: https://github.com/apache/hive/pull/5196#discussion_r1931322583


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java:
##########
@@ -138,6 +143,18 @@ public boolean isSynthetic() {
 
   @Override
   public RelWriter explainTerms(RelWriter pw) {
+    // Remove this if block after upgrading Calcite to 1.35+
+    if (CALCITE_VERSION < 35 
+        && pw.getDetailLevel() == SqlExplainLevel.ALL_ATTRIBUTES && 
getDigest().contains("SEARCH")) {
+      return ((HiveProject) this.accept(
+          RexUtil.searchShuttle(
+              new RexBuilder(new JavaTypeFactoryImpl(new 
HiveTypeSystemImpl())),
+              null,
+              -1
+          )
+      )).explainTerms(pw);
+    }

Review Comment:
   Applying the fix as done in Calcite is more involved, especially when we are 
planning to upgrade to 1.38+ soon after this upgrade. I am planning to expand 
SEARCH operator in `HiveRelJson#toJson` which will be a more generic way to do 
it, and simpler too.



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

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to