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

{ in sql would not allow the data model to compile #8250

Open
igorlukanin opened this issue May 9, 2024 · 2 comments
Open

{ in sql would not allow the data model to compile #8250

igorlukanin opened this issue May 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working data modeling:yaml

Comments

@igorlukanin
Copy link
Member

igorlukanin commented May 9, 2024

Describe the bug
Consider the following data model:

cubes:
  - name: gaue14kij3hmvnbnma3bu86g3e
    sql: >
      SELECT * FROM read_csv('s3://bbb/aaa.csv',delim = ',',header = true,columns={'time':'DATE','count':'NUMERIC'})

The SQL expression in sql is a legitimate one in DuckDB (https://duckdb.org/docs/data/csv/overview.html). However, Cube would not compile the data model, emitting the following error:

Can't parse python expression. Most likely this type of syntax isn't supported yet:
Unsupported Python multiple children node: Expr_stmtContext:
f"SELECT * FROM read_csv('s3://bbb/aaa.csv',delim = ',',header = true,columns={'time'<missing DOUBLE_QUOTE_SHORT_TEMPLATE_STRING_END>:'DATE'

Looks like this error has something to do with :.

Expected behavior
Cube compiles provided data model.

Version:
0.35.29

@igorlukanin igorlukanin added bug Something isn't working data modeling:yaml labels May 9, 2024
@igorlukanin igorlukanin changed the title Colon (:) in sql would not allow the data model to compile { in sql would not allow the data model to compile Sep 2, 2024
@dougmellon
Copy link

I can tackle this if nobody else is on it.

@igorlukanin
Copy link
Member Author

@dougmellon Sure, go for it! Please mention this issue in the PR when you open it.

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

No branches or pull requests

3 participants