[ 
https://issues.apache.org/jira/browse/CALCITE-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270464#comment-17270464
 ] 

Atul Mohan commented on CALCITE-4347:
-------------------------------------

I recently ran into this issue with the {color:#067d17}CONCAT{color} function 
with the following query. 

{color:#067d17}SELECT * FROM druid.foo WHERE dim2 like CONCAT('%', ?, 
'%'){color}

Any update on a fix for this issue?

 

 

 

> Illegal use of dynamic parameter when use preparestatement
> ----------------------------------------------------------
>
>                 Key: CALCITE-4347
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4347
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: yangzhang
>            Priority: Major
>
> hi , when query with preparestatement, validator throws exception.
> here is 2 sqls:
> 1、select LSTG_FORMAT_NAME
> from kylin_sales
> where LSTG_FORMAT_NAME=substring(?,1,6)
>  
> 2、select LSTG_FORMAT_NAME
> from kylin_sales
> where LSTG_FORMAT_NAME=substring(?,?,6)
>  
> trace is:
> Caused by: org.apache.calcite.runtime.CalciteContextException: At line 4, 
> column 34: Illegal use of dynamic parameter
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:803)
> at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:788)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4708)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1710)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1785)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1785)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereOrOn(SqlValidatorImpl.java:3906)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereClause(SqlValidatorImpl.java:3898)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3224)
> at 
> org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
> at 
> org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:949)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:930)
> at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:226)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:905)
> at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:615)
> at 
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:576)
> at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:269)
> at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:235)
> at 
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:804)
> at 
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:663)
> at 
> org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:626)
> at 
> org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:232)
> at 
> org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:214)
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to