You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by Hubert Stefani <hs...@novagen.tech> on 2017/11/27 12:52:37 UTC

SQL Error when using DEFAULT schema in query

Hi,

  when running query through the Insight tab (or any other mean like ODBC
connector), if the 'DEFAULT' Namespace is mentioned, the query results in
error.


2017-11-27 11:42:53,695 ERROR [Query
872553e9-f450-4fe4-9ab9-8e5130742e96-11999] service.QueryService:421 :
Exception when execute sql
java.sql.SQLException: Error while executing SQL "SELECT
NOVAPAK2.UTILISATEUR, NOVAPAK2.MODEL, NOVAPAK2.DEVICE, NOVAPAK2.GT  FROM
DEFAULT.NOVAPAK2 NOVAPAK2": parse failed: Encountered "FROM DEFAULT" at
line 1, column 76.
Was expecting one of:
    <EOF>
    "ORDER" ...
    "LIMIT" ...

If i ever put the table / model  in a different schema it works fine.

Should it be reported as a Calcite issue more than a kylin specific one ?

Hubert

Re: SQL Error when using DEFAULT schema in query

Posted by ShaoFeng Shi <sh...@apache.org>.
This is a known issue. "default" is a reserved keyword in Calcite. To
escape, use double quote together with upper case, for example:

select count(*) from "DEFAULT".kylin_sales

2017-11-27 20:52 GMT+08:00 Hubert Stefani <hs...@novagen.tech>:

> Hi,
>
>   when running query through the Insight tab (or any other mean like ODBC
> connector), if the 'DEFAULT' Namespace is mentioned, the query results in
> error.
>
>
> 2017-11-27 11:42:53,695 ERROR [Query 872553e9-f450-4fe4-9ab9-8e5130742e96-11999]
> service.QueryService:421 : Exception when execute sql
> java.sql.SQLException: Error while executing SQL "SELECT
> NOVAPAK2.UTILISATEUR, NOVAPAK2.MODEL, NOVAPAK2.DEVICE, NOVAPAK2.GT  FROM
> DEFAULT.NOVAPAK2 NOVAPAK2": parse failed: Encountered "FROM DEFAULT" at
> line 1, column 76.
> Was expecting one of:
>     <EOF>
>     "ORDER" ...
>     "LIMIT" ...
>
> If i ever put the table / model  in a different schema it works fine.
>
> Should it be reported as a Calcite issue more than a kylin specific one ?
>
> Hubert
>
>


-- 
Best regards,

Shaofeng Shi 史少锋