[ https://issues.apache.org/jira/browse/HIVE-26117?focusedWorklogId=755714&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-755714 ]
ASF GitHub Bot logged work on HIVE-26117: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Apr/22 11:59 Start Date: 12/Apr/22 11:59 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on code in PR #3179: URL: https://github.com/apache/hive/pull/3179#discussion_r848327228 ########## ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java: ########## @@ -2643,15 +2643,17 @@ private RelNode genJoinRelNode(RelNode leftRel, String leftTableAlias, RelNode r count++; } joinCond = count > 1 ? and : equal; - } else if (unparseTranslator != null && unparseTranslator.isEnabled()) { - genAllExprNodeDesc(joinCond, input, jCtx); } Map<ASTNode, RexNode> exprNodes = RexNodeTypeCheck.genExprNodeJoinCond( joinCond, jCtx, cluster.getRexBuilder()); if (jCtx.getError() != null) { throw new SemanticException(SemanticAnalyzer.generateErrorMessage(jCtx.getErrorSrcNode(), jCtx.getError())); } + for (Map.Entry<ASTNode, RexNode> entry : exprNodes.entrySet()) { + UnparseTranslatorHelper.addTranslationIfNeeded(entry.getKey(), entry.getValue(), Review Comment: I think we are kinda approach a point where we should have the unparse translator enabled at all times... I wonder how much we gain by keeping the support to have it disabled... ########## ql/src/java/org/apache/hadoop/hive/ql/parse/UnparseTranslatorHelper.java: ########## @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.ql.parse; + +import org.apache.calcite.rex.RexInputRef; +import org.apache.calcite.rex.RexNode; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.exec.ColumnInfo; +import org.apache.hadoop.hive.ql.metadata.HiveUtils; + +/** + * Class containing static methods that help populate the UnparseTranslator. + */ +public class UnparseTranslatorHelper { + + /** + * Adds translation to the unparseTranslator for the RexNode if it is a RexInputRef. + * Grabs the inputRef information from the given RowResolver. + */ + public static void addTranslationIfNeeded(ASTNode astNode, RexNode rexNode, RowResolver rr, Review Comment: I think it would make sense to have this inside the `UnparseTranslator` class instead...(I don't think there will be more functions added in the near future) Issue Time Tracking ------------------- Worklog Id: (was: 755714) Time Spent: 0.5h (was: 20m) > Remove 2 superfluous lines of code in genJoinRelNode > ---------------------------------------------------- > > Key: HIVE-26117 > URL: https://issues.apache.org/jira/browse/HIVE-26117 > Project: Hive > Issue Type: Bug > Components: CBO > Reporter: Steve Carlin > Assignee: Steve Carlin > Priority: Minor > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > The code was rewritten to associate ASTNodes to RexNodes. Some code was left > behind that doesn't add any value. -- This message was sent by Atlassian Jira (v8.20.1#820001)