Skip to content

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

@igorlukanin

Description

@igorlukanin

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions