Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating a parameterized view using clickhouse-jdbc, a query parsing error occurs #1818

Open
com-exem-route7 opened this issue Sep 10, 2024 · 1 comment
Labels

Comments

@com-exem-route7
Copy link

com-exem-route7 commented Sep 10, 2024

Description

Occasionally, when creating a parameterized view, the query does not get parsed correctly.

  • ClickHouse Version: 24.5.1.1763 (2R-1S)
  • ClickHouse JDBC Version: clickhouse-jdbc-0.6.2-all.jar

Create Parameterized View Statement

CREATE VIEW default.test
AS 
WITH    
    toDateTime({from:String}, 'Asia/Seoul') AS FROM,    
    date_add(FROM, INTERVAL 1 MINUTE) AS TO,    
    {target_id:String} AS TARGET_ID 
SELECT FROM, TO, TARGET_ID

Debug

image

Result

CREATE VIEW default.test
AS 
WITH    
    toDateTime({from:String}, 'Asia/Seoul') AS FROM,    
    date_add(FROM, INTERVAL 1 MINUTE) AS TO,    
    {target_id:String} AS TARGET_ID 
SELECT FROM, TO, TARGET_ID
;


SELECT * 
FROM system.query_log 
WHERE 
    event_date = '2024-09-10' 
    AND event_time >= toDateTime('2024-09-10 16:14:00', 'Asia/Seoul') 
    AND user = 'admin'
;

image

@mohaidoss
Copy link

Up ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants