calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongming Liu (JIRA)" <>
Subject [jira] [Created] (CALCITE-1961) RelToSqlConverter error when join with NOT equals conditon
Date Wed, 23 Aug 2017 12:40:00 GMT
Dongming Liu created CALCITE-1961:

             Summary: RelToSqlConverter error when join with NOT equals conditon
                 Key: CALCITE-1961
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.11.0
            Reporter: Dongming Liu
            Assignee: Julian Hyde

For SQL:

select c_custkey from customer join orders on c_custkey = o_custkey and o_comment not like

Its RelNode has a JOIN that condition as follow:

condition = {RexCall@7367} "AND(=($0, $9), $17)"
 op = {SqlBinaryOperator@7377} "AND"
 operands = {RegularImmutableList@7378}  size = 2
  0 = {RexCall@7383} "=($0, $9)"
  1 = {RexInputRef@7384} "$17"
 type = {BasicSqlType@7379} "BOOLEAN"
 digest = "AND(=($0, $9), $17)"

The second operand of AND is a RexInputRef.

When I call the RelToSqlConverter to convert the RelNode to SqlNode, I have exception as follows:

java.lang.AssertionError: Internal error: While invoking method 'public org.apache.calcite.rel.rel2sql.SqlImplementor$Result
	at org.apache.calcite.util.Util.newInternal( ~[classes/:na]
	at org.apache.calcite.util.ReflectUtil$2.invoke( ~[classes/:na]
	at org.apache.calcite.rel.rel2sql.RelToSqlConverter.dispatch( ~[classes/:na]
	at org.apache.calcite.rel.rel2sql.RelToSqlConverter.visitChild(

*convertConditionToSqlNode* be called to build the join condition by RelToSqlConverter, and
it has follow code:

 if (!(node instanceof RexCall)) {
      throw new AssertionError(node);

RexInputRef is obviously not a RexCall.

Is this a bug? And is there any methods to convert RelNode like this to SqlNode?

This message was sent by Atlassian JIRA

View raw message