Skip to content

[jdbc-v2] LightParser Implementation #2797

Open

Description

@chernser

Description

JDBC Driver has some tasks where parser is the best choice. Parser at the same time is a big issue because if it cannot validate new statement we have to fix it in the code.
We need to develop a version that parses only specific statements and passes rest of them to server.

This parser should be implemented with ANTLR4 for better portability.
It requires good negative testing to verify that most statements are not blocked by parse.
It required complete coverage for known statements.

Activity

  1. added
    jdbc
    sql-parser
    dependencies
    and removed
    dependencies
    on Mar 18, 2026
  2. added this to the 0.10.0 milestone on Apr 15, 2026
  3. removed this from the 0.12.0 milestone on Nov 10, 2026
  4. added
    queries
    on Nov 26, 2026
  5. polyglotAI-bot commented on Nov 27, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Keep open — implementation needed
    main has no parser that reads only some statements and sends the others through unchanged. The issue does not list the statements that the light parser must read; a maintainer can add that list before the work starts.

    Analysis: jdbc-v2 has three parsers, selected by jdbc_sql_parser (DriverProperties.java:84, default JAVACC; SqlParserFacade.java:731), and each is a full grammar for all statement kinds (ClickHouseParser.g4:13-46, ClickHouseSqlParser.jj). A statement that a grammar does not match is not blocked: the driver sends it as a query (ClickHouseSqlParser.jj:95-104, SqlParserFacade.java:254). But the facts that the driver reads from it (kind, table, values list) can be wrong, and a new server keyword can need a grammar change: the related grammar issues are such cases.

    Automated triage by Polyglot AI. A maintainer makes the final decision.

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

    enhancementjdbcqueriessql-parser

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions