Skip to content

Error handling the CTE INSERT command: Failed to parse SQL. #3279

Open

Description

@fiend19961
High Level Area Labels: 
 - jdbc-v2

Specific Area Labels:
  - jdbc-insert
  - client-insert

Description

Steps to reproduce

  1. for examples , create table test123
CREATE TABLE IF NOT EXISTS test123
(
   `timestamp`     DateTime64(9, 'UTC'),
    `eid`       UInt64,
) ENGINE = MergeTree()
        PARTITION BY toYYYYMMDD(timestamp)
        ORDER BY (timestamp);
  1. execute this sql
with a as (
SELECT timestamp,eid
FROM test123 
),
b as ( SELECT timestamp,eid
FROM test123 )

insert into test123(`timestamp`,eid) 
SELECT a.`timestamp`,b.eid
FROM a left join b on a.eid =b.eid ;
  1. The SQL server executed successfully, but the client-side parsing failed,Maybe this is a bug in the JavaCC parser

Error Log or Exception StackTrace

WARN  c.c.j.i.p.j.ClickHouseSqlParser [76] - Failed to parse SQL. If you believe the SQL is valid, please feel free to open an issue on GitHub with this warning. Enable DEBUG logging for details.

Expected Behaviour

Code Example

Configuration

Client Configuration

Environment

  • Client version: JDBC-0.11.0
  • Language version: JDK17
  • OS: linux,windows10

ClickHouse Server

  • ClickHouse Server version: 25.8.24.21

Activity

  1. added this to the 0.12.0 milestone on Oct 30, 2026
  2. removed this from the 0.12.0 milestone on Nov 10, 2026
  3. fiend19961 commented on Nov 12, 2026

    @fiend19961
    Author
  4. chernser commented on Nov 17, 2026

    @chernser
    Contributor

    @fiend19961
    Thank you for reporting!

    Will be fixed as part of #3300

    This is a logging issue because client may not follow ClickHouse in syntax parsing and we just use parser to get needed information.
    Fix in parser may break someone`s case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions