FAQ
Author: hashutosh
Date: Thu Sep 11 21:44:03 2014
New Revision: 1624403

URL: http://svn.apache.org/r1624403
Log:
HIVE-8060 : [CBO] Handle tables with serde supplied schema (Ashutosh Chauhan via John Pullokkaran)

Modified:
     hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java?rev=1624403&r1=1624402&r2=1624403&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java Thu Sep 11 21:44:03 2014
@@ -129,8 +129,17 @@ public class RexNodeConverter {
    }

    private RexNode convert(final ExprNodeFieldDesc fieldDesc) throws SemanticException {
- return m_cluster.getRexBuilder().makeFieldAccess(convert(fieldDesc.getDesc()),
- fieldDesc.getFieldName(), true);
+ RexNode rexNode = convert(fieldDesc.getDesc());
+ if (rexNode instanceof RexCall) {
+ // regular case of accessing nested field in a column
+ return m_cluster.getRexBuilder().makeFieldAccess(rexNode,
+ fieldDesc.getFieldName(), true);
+ } else {
+ // This may happen for schema-less tables, where columns are dynamically
+ // supplied by serdes.
+ throw new OptiqSemanticException("Unexpected rexnode : " +
+ rexNode.getClass().getCanonicalName());
+ }
    }

    private RexNode convert(final ExprNodeGenericFuncDesc func) throws SemanticException {

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedSep 11, '14 at 9:44p
activeSep 11, '14 at 9:44p
posts1
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 1 post

People

Translate

site design / logo © 2021 Grokbase