I figured it out.

When initializing a SqlValidator, we need to pass in a SqlValidator.Config
which has a method called withConformance where we can pass in a
SqlConformance instance which has a config isGroupByOrdinal.

Thomas

On Mon, Dec 26, 2022 at 5:48 AM Thomas Wang <w...@datability.io> wrote:

> Hi Calcite community,
>
> I'm trying to validate a SQL like the one below.
>
> SELECT user_id, COUNT(1) cnt FROM schema.table_name GROUP BY 1;
>
> It looks like in the default configuration, GROUP BY 1 is not considered
> valid. It complains user_id is not being grouped.
>
> Is there a quick configuration that enables syntax like that? I'm looking
> at SqlParser.Config, but none of them seems to be relevant to this.
>
> Thanks.
>
> Thomas
>

Reply via email to