Hi Sophie~

FIRST and  LAST are keywords, but they also are nonReservedKeywords[1].

I found a JIRA ticket[2] about FIRST_VALUE/LAST_VALUE, maybe it is useful
for you.

Refs:
[1]
https://github.com/apache/calcite/blob/2feb16aee9f2710bd361a787a80e1cd74cf759bb/core/src/main/codegen/default_config.fmpp#L116
[2] https://issues.apache.org/jira/browse/CALCITE-883

On Thu, 20 Oct 2022 at 03:50, Julian Hyde <[email protected]> wrote:

> According to this [1] FIRST is a synonym for FIRST_VALUE, which
> Calcite already has.
>
> Please log a Jira case describing the feature you want. Then design
> discussions can occur against that case.
>
> Have a look through the commit log at how people have added
> dialect-specific functions. Usually adding functions doesn't require
> parser changes. But if FIRST and LAST are keywords maybe parser
> changes are required.
>
> Julian
>
> [1]
> https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/first.html
>
> On Wed, Oct 19, 2022 at 8:10 AM Sophie Mugridge White
> <[email protected]> wrote:
> >
> > Hi,
> >
> > I'm looking to add support for the Spark FIRST and LAST functions.
> >
> > Please can I have some pointers as to where to look? In particular in
> > reference to how it can be handled separately than the FIRST function
> > that's part of MATCH_RECOGNIZE
> >
> > Thanks,
> > Sophie
> >
> > --
> > This email is confidential, if you are not the intended recipient please
> > delete it and notify us immediately by emailing the sender. You should
> not
> > copy it or use it for any purpose nor disclose its contents to any other
> > person. Privitar Limited is registered in England with registered number
> > 09305666. Registered office Salisbury House, Station Road, Cambridge,
> > CB12LA.
>

Reply via email to