Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-23 Thread Muhammad Gelbana
Nevermind, I successfully parsed the operator and all test cases are passing. I'm working on implementing the operator now. Thanks, Gelbana On Thu, Feb 21, 2019 at 12:08 AM Muhammad Gelbana wrote: > I'm struggling with parsing the expressoin properly. If I simply add the > operator (i.e. ::)

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-20 Thread Muhammad Gelbana
I'm struggling with parsing the expressoin properly. If I simply add the operator (i.e. ::) to the binary operators list, the query is parsed but the operand that is supposed to be a type, is parsed as an identifier instead. And eventually the validation fails because that identifier (ex: integer,

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-15 Thread Julian Hyde
I’ve added comments to the JIRA case. > On Feb 15, 2019, at 5:22 AM, Muhammad Gelbana wrote: > > Here is what I've done so far for CALCITE-2843 > : > https://github.com/MGelbana/calcite/pull/1/files > I appreciate a quick overview and guidance

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-15 Thread Muhammad Gelbana
Here is what I've done so far for CALCITE-2843 : https://github.com/MGelbana/calcite/pull/1/files I appreciate a quick overview and guidance if I'm going in the wrong direction. Thanks, Gelbana On Thu, Feb 14, 2019 at 5:57 PM Muhammad Gelbana

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-14 Thread Muhammad Gelbana
@Stamatis, I very appreciate you taking the time to comment on the issues I opened basd on this thread. I'm currently going through Babel's Parser.jj file and JavaCC documentations trying to understand what I need to do and where. Considering you're probably more acquainted than I am. I'll gladly

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-11 Thread Muhammad Gelbana
Your replies are very much appreciated. I'll see what I can do. @Julian, I believe '=' acts as a boolean operator here because the query returns boolean results for that part of the selection. Thanks, Gelbana On Mon, Feb 11, 2019 at 8:38 PM Julian Hyde wrote: > There are a few Postgres-isms

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-11 Thread Julian Hyde
There are a few Postgres-isms in that SQL: The “::” (as a shorthand for cast) in 'typinput='array_in'::regproc The ‘=‘ (as a shorthand for alias) in 'typinput='array_in'::regproc’ Use of a table function without the ’TABLE’ keyword, in 'from generate_series(1, array_upper(current_schemas(false),

Re: Failed to parse a PostgreSQL query using the Babel conformance

2019-02-11 Thread Stamatis Zampetakis
Hi Gelbana, In order to use the Babel parser you need to also set an appropriate factory to your parser configuration since setting only the conformance is not enough. Try adding the following: ... configBuilder().setParserFactory(SqlBabelParserImpl.FACTORY); Having said that I am not sure if

Failed to parse a PostgreSQL query using the Babel conformance

2019-02-09 Thread Muhammad Gelbana
I'm trying to parse a PostgreSQL metadata query but a parsing exception is thrown. Here is my code: Config parserConfig = configBuilder().setConformance(SqlConformanceEnum.BABEL).build(); FrameworkConfig frameworkConfig = Frameworks.newConfigBuilder().parserConfig(parserConfig).build(); Planner