Hi Thomas,

Cast map syntax is not supported in the current release version.
But we will support it in the 1.36.0 version.

FYI: https://issues.apache.org/jira/browse/CALCITE-5570

On Sun, 1 Oct 2023 at 22:38, Thomas Wang <w...@datability.io> wrote:

> Hi Mihai,
>
> Could you point me to more information w.r.t modifying the parser? Also, I
> noticed for the ARRAY type, I can do CAST(NULL AS BIGINT ARRAY), but the
> grammar doesn't seem to have MAP supported, does it? Did I miss something?
> Thanks.
>
> Thomas
>
> On Sat, Sep 30, 2023 at 7:59 PM Mihai Budiu <mbu...@gmail.com> wrote:
>
> > Calcite is open source, so you can certainly modify the parser. The
> > architecture of the parser had been designed to be flexible and even
> > calcite has several parsers, the strandard one, server, and Babel. Let me
> > know if you need help figuring out how to roll your own.
> >
> > Mihai
> > ________________________________
> > From: Thomas Wang <w...@datability.io>
> > Sent: Saturday, September 30, 2023 7:42:19 PM
> > To: dev@calcite.apache.org <dev@calcite.apache.org>
> > Subject: Re: SQL Parsing
> >
> > Thanks Mihai, "BIGINT ARRAY" seems to work! Just curious if I can have
> > flexibility to change the behavior of the parse to parse "ARRAY<BIGINT>"
> > instead?
> >
> > Thomas
> >
> > On Sat, Sep 30, 2023 at 6:32 PM Mihai Budiu <mbu...@gmail.com> wrote:
> >
> > > The syntax is "bigint array"
> > > https://calcite.apache.org/docs/reference.html
> > > ________________________________
> > > From: Thomas Wang <w...@datability.io>
> > > Sent: Saturday, September 30, 2023 6:27:46 PM
> > > To: dev@calcite.apache.org <dev@calcite.apache.org>
> > > Subject: SQL Parsing
> > >
> > > Hi Apache Calcite Community,
> > >
> > > I'm new to Apache Calcite and trying to use it for SQL parsing and SQL
> > > rewriting.
> > >
> > > I tried to parse a couple of SELECT statements and it works pretty
> well.
> > > However, when I tried to parse a SELECT statement that contains a cast
> to
> > > array like below, it complains it cannot recognize ARRAY.
> > >
> > > SELECT CAST(NULL AS ARRAY<BIGINT>) FROM schema.t1
> > >
> > > However, casting to BIGINT seems ok. The following SELECT is ok.
> > >
> > > SELECT CAST(NULL AS BIGINT) FROM schema.t1
> > >
> > > Is there any configuration I need to enable to enable/support parsing
> > > ARRAY? Thanks.
> > >
> > > Thomas
> > >
> >
>

Reply via email to