dynamobi/dynamobi — Issue #762: [FRG-108] 'IN <list>' fails in validator
Author: dynamobi-build
Created: 2011-12-30 03:47:39+00:00
State: open
Labels: FRG, SQL Validator

[reporter="jhyde", created="Mon, 17 Apr 2006 14:53:31 -0500 (GMT-05:00)"]
'IN

' fails in validator.

Example:

SELECT * FROM emp

WHERE empno IN (100, 110)

Stack:

java.lang.UnsupportedOperationException: class org.eigenbase.sql.SqlNodeList: 100, 110

at org.eigenbase.util.Util.needToImplement(Util.java:932)

at org.eigenbase.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1113)

at org.eigenbase.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:803)

at org.eigenbase.sql.SqlNode.validateExpr(SqlNode.java:243)

at org.eigenbase.sql.SqlOperator.validateCall(SqlOperator.java:376)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateCall(SqlValidatorImpl.java:2765)

at org.eigenbase.sql.SqlCall.validate(SqlCall.java:131)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateWhereClause(SqlValidatorImpl.java:2128)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:2010)

at org.eigenbase.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:54)

at org.eigenbase.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:76)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:483)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:474)

at org.eigenbase.sql.SqlSelect.validate(SqlSelect.java:153)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:451)

at org.eigenbase.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:276)

at net.sf.farrago.query.FarragoSqlValidator.validate(FarragoSqlValidator.java:62)

at net.sf.farrago.db.FarragoDatabase.prepareStmtImpl(FarragoDatabase.java:738)

at net.sf.farrago.db.FarragoDatabase.prepareStmt(FarragoDatabase.java:674)

at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:829)

at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:771)

at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:108)

at net.sf.farrago.jdbc.engine.FarragoJdbcEngineStatement.execute(FarragoJdbcEngineStatement.java:105)

at sqlline.SqlLine$Commands.execute(Unknown Source)

at sqlline.SqlLine$Commands.sql(Unknown Source)

at sqlline.SqlLine.dispatch(Unknown Source)

at sqlline.SqlLine.begin(Unknown Source)

at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)

at sqlline.SqlLine.main(Unknown Source)

The construct 'x IN (expr1, expr2, ...)' is equivalent to 'x = expr1 OR x = expr2 ...' (even in the case of null values). Will need to fix validator and sql-to-rel translator.