Unable to use default as database name

2019-04-02 Thread Jeff Zhang
Hi Folks, I try to integrate calcite into our product, and found that I can not use default as the database name. (select * from default.table_1) I will hit the following error. Is there any way that I can use default as database name ? Thanks org.apache.calcite.sql.parser.SqlParseException: Enc

Re: Unable to use default as database name

2019-04-02 Thread Amit Weitzner
Hi Jeff, "default" is a reserved keyword in calcite parser. If you'll add quoting to default it will work: select * from "default".table_1 select * from `default`.table_1 The quotation marks depend on your configuration in the calcite parser (the default is "). Hope this helps, Amit On Tue, A

elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Maria
Hi, calcite developers. I met a question about es-adapter and still cannot resove it: . 1) calcite version :1.18.0 2) ES version : 5.4.1(I know that in calcite-1.18.0 is 6.4.2) 3) test sql : select count(*) from test 4) elasticsearch-model.json as follow: { "version": "1.0","defaultSchema": "e

Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Yuzhao Chen
For Object 'test' not found it means Calcite does not load your son model correctly, so it can not find then validate the table there. Maybe you model file is not load correctly. I saw a demo in Calcite code in [1], the path sep is while your sep is <\\>, can you have a try ? [1]  https://git

Re: Unable to use default as database name

2019-04-02 Thread Jeff Zhang
Thanks Amit. I'd like to keep my system compatible with hive sql, but unfortunately hive use default as its default database name. Is there any way to customize calcite's parser to allow user to use default ? Amit Weitzner 于2019年4月2日周二 下午6:36写道: > Hi Jeff, > > "default" is a reserved keyword in

Re: Unable to use default as database name

2019-04-02 Thread YuZhao Chen
Calcite's parser use JavaCC and the built in keywords are configured hard-code, so there is no way to change this. An quote character may be a better choice. Jeff Zhang 于2019年4月2日 周二下午9:15写道: > Thanks Amit. I'd like to keep my system compatible with hive sql, but > unfortunately hive use default

[jira] [Created] (CALCITE-2974) Timestamp conversion performance can be improved

2019-04-02 Thread Valeriy Trofimov (JIRA)
Valeriy Trofimov created CALCITE-2974: - Summary: Timestamp conversion performance can be improved Key: CALCITE-2974 URL: https://issues.apache.org/jira/browse/CALCITE-2974 Project: Calcite

Re:Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Maria
Firstly,thanks for your reply. But I'm sure that my local elasticsearch-model.json has been loaded correctly,because when getting connect,read the elastic info from that file. I will debug the test-demo again...Search for the cause of the problem. Best wishes. Maria. At 2019-04-02 19:54:24,

Re: Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Andrei Sereda
Can you check that it's not because of lex ? What if you quote table name "test" ? Maybe uppercase ? On Tue, Apr 2, 2019, 22:42 Maria wrote: > Firstly,thanks for your reply. > But I'm sure that my local elasticsearch-model.json has been loaded > correctly,because when getting connect,read the el

[jira] [Created] (CALCITE-2975) Add the JSON_REMOVE function

2019-04-02 Thread Forward Xu (JIRA)
Forward Xu created CALCITE-2975: --- Summary: Add the JSON_REMOVE function Key: CALCITE-2975 URL: https://issues.apache.org/jira/browse/CALCITE-2975 Project: Calcite Issue Type: New Feature

Re:Re: Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Maria
Nope, the index name in elasticsearch is full lowercase. At 2019-04-03 09:47:02, "Andrei Sereda" wrote: >Can you check that it's not because of lex ? >What if you quote table name "test" ? Maybe uppercase ? > >On Tue, Apr 2, 2019, 22:42 Maria wrote: > >> Firstly,thanks for your reply. >> But I'

Re:Re: Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Maria
And, if the name is not correct, creating ElasticsearchSchema will be failed. The program will not performs "ResultSet result = ss.excuteQuery(sql);" At 2019-04-03 09:47:02, "Andrei Sereda" wrote: >Can you check that it's not because of lex ? >What if you quote table name "test" ? Maybe upper

Re: Re: Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Andrei Sereda
You define your default schema as "elasticsearch" but then elastic schema is called "test" : , "schemas": [ { "type": "custom", "name": "test" ..., index:"test" }] Also if you don't explicitly specify ES type all types for index "test" will be imported. So it is possible that there is no test.te

[jira] [Created] (CALCITE-2976) Improve materialized view rewriting coverage with disjunctive predicates

2019-04-02 Thread Jesus Camacho Rodriguez (JIRA)
Jesus Camacho Rodriguez created CALCITE-2976: Summary: Improve materialized view rewriting coverage with disjunctive predicates Key: CALCITE-2976 URL: https://issues.apache.org/jira/browse/CALCITE-2976

Re: About aggregation problem

2019-04-02 Thread wmy7ymw
This snippet works for me: @Test public void pg() throws SqlParseException { String sql = "select count(distinct a_column) from some_table"; SqlParser.create(sql).parseQuery(); } On Mon, Apr 1, 2019 at 8:30 PM kakasi2...@163.com wrote: > hello, > > The problem is about use [count(distinct(

Re:Re: Re: Re: elasticsearch-adapter test failed with "Object 'test'" not found

2019-04-02 Thread Maria
Thank you so much ,Andrei ,your perspective inspired me. There is no test.test in test index. I changed another table which has multi-type, it works! BUT, also, I hava one another question: why elasticsearch-adapter do not support querying "default" type(eg. test.default) ? At 2019-04-03 10:32: