OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2320) UDF in WHERE expression incorrectly pushed down to jdbc schema


Piotr Bojko created CALCITE-2320:
------------------------------------

             Summary: UDF in WHERE expression incorrectly pushed down to jdbc schema
                 Key: CALCITE-2320
                 URL: https://issues.apache.org/jira/browse/CALCITE-2320
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.16.0, 1.17.0
            Reporter: Piotr Bojko
            Assignee: Julian Hyde
             Fix For: 1.17.0


# Checks whether CHOOSENCUSTOMFUNCTION function is properly computed and not passed to subschema, like jdbc
SELECT * FROM SIMPLE_CUSTOMER WHERE email = CHOOSENCUSTOMER();

where CHOOSENCUSTOMER is UDF leads to 
{code}
 Caused by: java.lang.RuntimeException: while executing SQL [SELECT "FIRSTNAME", "LASTNAME", "EMAIL"
> FROM "CUSTOMER"
> WHERE "EMAIL" = "CHOOSENCUSTOMER"()]
> 	at org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:153)
> 	at org.apache.calcite.linq4j.AbstractEnumerable.iterator(AbstractEnumerable.java:33)
> 	at org.apache.calcite.avatica.MetaImpl.createCursor(MetaImpl.java:90)
> 	at org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:174)
> 	at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
> 	at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
> 	at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
> 	at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619)
> 	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> 	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> 	... 24 more
> Caused by: java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: CHOOSENCUSTOMER
> 	at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> 	at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
> 	at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
> 	at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
> 	at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> 	at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> 	at org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:143)
> 	... 33 more
> Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: CHOOSENCUSTOMER
> 	at org.hsqldb.error.Error.error(Unknown Source)
> 	at org.hsqldb.error.Error.error(Unknown Source)
> 	at org.hsqldb.Routine.getMethods(Unknown Source)
> 	at org.hsqldb.Routine.createRoutines(Unknown Source)
> 	at org.hsqldb.ParserDQL.readColumnOrFunctionExpression(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadSimpleValueExpressionPrimary(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadAllTypesValueExpressionPrimary(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadAllTypesPrimary(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadAllTypesFactor(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadAllTypesTerm(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadAllTypesCommonValueExpression(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadRowOrCommonValueExpression(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadRowValuePredicand(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadPredicateRightPart(Unknown Source)
> 	at org.hsqldb.ParserDQL.XreadBooleanPrimaryOrNull(Unknown Source)
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)