Skip to content

Trino split_statements is default to False #47167

@willshen99

Description

@willshen99

Apache Airflow Provider(s)

trino

Versions of Apache Airflow Providers

6.0.1

Apache Airflow version

2.9.0

Operating System

Red Hat Enterprise Linux 9.5

Deployment

Virtualenv installation

Deployment details

No response

What happened

I'm following this document to use SQLExecuteQueryOperator to issue multiple queries separated with semicolon to Trino.
I got a syntax error complaining mismatched input ';'. I have to add an additional split_statements=True parameter to get it work.

What you think should happen instead

SQLExecuteQueryOperator defers split_statements to the default value in the run method of the configured hook. Such is not defined in TrinoHook, so it uses default False from DbApiHook and throws the error.

How to reproduce

SQLExecuteQueryOperator(
    task_id='t1',
    sql='SELECT 1; SELECT 2;',
    conn_id='loading_user_trino'     # Adding split_statements=True will work
)

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions