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

Adding a comment at the end of a query results in a syntax error #256

Closed
tevariou opened this issue Mar 13, 2024 · 3 comments · Fixed by #262
Closed

Adding a comment at the end of a query results in a syntax error #256

tevariou opened this issue Mar 13, 2024 · 3 comments · Fixed by #262
Labels
bug Something isn't working

Comments

@tevariou
Copy link
Contributor

Describe the bug

Steps to reproduce

  1. Add a comment at the last line of a model
select * 
from {{ ref('some_ref') }}
where id = 1 -- some comment
  1. Run model
  2. Get an error
 Code: 62. DB::Exception: Syntax error: failed at position 15 ('(') (line 1, col 15): (select

Expected behaviour

To not raise a syntax error

Code examples, such as models or profile settings

dbt and/or ClickHouse server logs

Configuration

Environment

  • dbt version: 1.7.9
  • dbt-clickhouse version: 1.7.3
  • clickhouse-driver version (if using native): 0.2.6
  • clickhouse-connect version (if using http): 0.7.2
  • Python version: 3.10.9
  • Operating system: MacOS / Linux

ClickHouse server

  • ClickHouse Server version: 23.8
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
  • Sample data for these tables, use clickhouse-obfuscator if necessary
@tevariou tevariou added the bug Something isn't working label Mar 13, 2024
@tevariou
Copy link
Contributor Author

related: #212

@emirkmo
Copy link

emirkmo commented Mar 26, 2024

to be clear #212 seems to have not solved the problem.

@tevariou Can you by any chance paste in the compiled code as well as where it actually errors? It seems cutoff.

@tevariou
Copy link
Contributor Author

tevariou commented Mar 26, 2024

@emirkmo
Model

select 
    *
from
    {{ get_source("mimic_iii", 'admissions') }} -- test

Compiled:

select 
    *
from
    `mimic`.`admissions` -- test

Screenshot 2024-03-26 at 15 33 34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants