You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2016/03/08 21:20:40 UTC

[jira] [Resolved] (CALCITE-1131) Getting error Non-query expression encountered in illegal context

     [ https://issues.apache.org/jira/browse/CALCITE-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-1131.
----------------------------------
       Resolution: Invalid
    Fix Version/s:     (was: 1.4.0-incubating)

If might be that you have a column called "value". It might be that you are using '@', which is not supported in Calcite's SQL dialect (or standard SQL). It might be that you have two statements on one line. You are using functions ISNULL and NOW which Calcite doesn't support.

Please don't log bugs unless you are fairly certain that it the problem is with Calcite.

> Getting error Non-query expression encountered in illegal context
> -----------------------------------------------------------------
>
>                 Key: CALCITE-1131
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1131
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.4.0-incubating
>            Reporter: Shyam
>            Assignee: Julian Hyde
>
> Trying to parse below query string
>   INSERT ignore INTO temp_ppd              (job_id, planning_point_seq,               detail_id,               ts_business_name_id,               period_id,               value,               audit_id,               is_user_override,is_computed)  SELECT DISTINCT @JOB_ID, denorm.output_ppt_seq,         denorm.detail_id,         denorm.ts_business_name_id,         denorm.period_id,  case when ( isnull(view1.c1_numeric_05,0) ) = 1.0 then isnull(ppd3.value,0) else isnull(ppd2.value,0) end,  rii.audit_id,         0 is_user_override,Cast (1 AS TINYINT) is_computed  FROM rule_input_interface_@JOB_ID rii         JOIN rule_output_input_map_denormalize denorm           ON rii.output_ppt_seq = denorm.output_ppt_seq          JOIN VWSEARCH_VIEW view1 ON view1.DETAIL_ID = denorm.detail_id          left join planning_point_data ppd2 on ppd2.planning_point_seq = denorm.param2_ppt_seq and ppd2.ts_business_name_id = 111          left join planning_point_data ppd3 on ppd3.planning_point_seq = denorm.param3_ppt_seq and ppd3.ts_business_name_id = 323     WHERE denorm.ts_business_name_id = 130 and rii.ts_business_name_id = 130 and rii.batch_id=@BATCH_ID;     INSERT ignore INTO temp(job_id, rundate) value(@JOB_ID ,now()); 
> But getting 
> SEVERE: org.apache.calcite.runtime.CalciteContextException: At line 1, column 63: Non-query expression encountered in illegal context
> 2016-03-09 00:08:35 ERROR [http-bio-8080-exec-3] (ImpalaScriptParser.java:74) - org.apache.calcite.sql.parser.SqlParseException: Non-query expression encountered in illegal context
> 	at org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:388)
> 	at org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:118)
> 	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:130)
> 	at com.steelwedge.calcite.ImpalaScriptParser.isImpalaCompiled(ImpalaScriptParser.java:67)
> Please help me , how to resolve this issue ?
> What went wrong here ?
> thank you.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)