Skip to content

[BUG] JSQLParser 5.4-SNAPSHOT : ClickHouse : Tuple positional access via .N not supported in SELECT #2442

Description

@tomershay

Failing SQL Feature

ClickHouse supports accessing tuple elements by their 1-based position using a .N suffix, such as tuple(1, 2, 3).2 which returns 2. The .N acts like a member accessor but with an integer index rather than a name. JSQLParser fails to parse this positional tuple access, treating the .2 as a floating-point token instead of an element accessor.

See the ClickHouse docs:

https://clickhouse.com/docs/en/sql-reference/data-types/tuple

Full SQL Example

  CREATE TABLE tuple_demo (id UInt32) ENGINE = MergeTree ORDER BY id;
  INSERT INTO tuple_demo (id) VALUES (1);
  SELECT tuple(1, 2, 3).2 FROM tuple_demo;

Parsing Error

  ParseException: Encountered: <S_DOUBLE> / ".2", at line 1, column 22,
  in lexical state DEFAULT.
  Was expecting one of these terminals within expansion starting at 1753:23:
      <EOF> (inside 1753:23)
      <ST_SEMICOLON> (inside 1753:23)

Tested with ClickHouse version: 25.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions