Skip to content

[JDBC-V2] Statement.execute() returns false for CTE queries #2574

Closed

Description

@chernser

Description

When com.clickhouse.jdbc.StatementImpl#execute(java.lang.String) is called for query that returns result set then method should return true.
It doesn't happen for such CTE:

WITH
	toDate('2025-08-20') as DATE_END
	,events AS (
		SELECT 1
	)
SELECT *
FROM events

However is works correctly for:

WITH events AS (
	WITH toDate('2025-08-20') as DATE_END
	SELECT 1
)
SELECT *
FROM events

Relates: dbeaver/dbeaver#39061

WITH FILL doesn't work too:

select value, toUnixTimestamp(ts)* 1000 as timestamp
from(select count() as value, toStartOfInterval(timestamp, interval 1 day) as ts
from events
where timestamp between toDateTime(1736035200) and toDateTime(1751587199)
group by ts
order by ts
with fill
from toDateTime(1736035200) to toDateTime(1751587199)
step interval '1 day');

Relates: dbeaver/dbeaver#38556

Environment

  • Cloud
  • Client version: 0.9.2
  • Language version:
  • OS:

Activity

  1. added this to the 0.9.3 milestone on Sep 9, 2025
  2. added
    jdbc
    sql-parser
    on Sep 9, 2025
  3. chernser commented on Oct 27, 2025

    @chernser
    ContributorAuthor

    Verified with com.clickhouse.jdbc.StatementSQLTest

  4. added
    queries
    on Nov 26, 2026
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

    bugjdbcqueriessql-parser

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions