Skip to content

TrinoOperator not allowing to run multiple sql statements from file #27610

@sbbagal13

Description

@sbbagal13

Apache Airflow Provider(s)

trino

Versions of Apache Airflow Providers

apache-airflow-providers-trino 4.0.0

Apache Airflow version

2.2.4

Operating System

Debian GNU/Linux 10 (buster)

Deployment

Official Apache Airflow Helm Chart

Deployment details

Openshift on prem deployment

What happened

When putting two queries in SQL file and providing to trino operator it failing with unexpected syntax for ending first query with semicolon
run_queries = TrinoOperator( task_id="push_to_refined", trino_conn_id='trino-conn', sql="scripts/platform/sql/execute_queries.sql", handler=list, )

Error:
`io.trino.sql.parser.ParsingException: line 1:67: mismatched input ';'. Expecting: '%', '*', '+', '-', '.', '/', 'AND', 'AT', 'OR', '[', '||', <EOF>, <predicate>
at io.trino.sql.parser.ErrorHandler.syntaxError(ErrorHandler.java:109)`

There are two queries in sql file , One is for setting session properties which I can't take into different task 
SQL file runs fine on CLI

What you think should happen instead

It should run without execption as its execute on trino CLI

How to reproduce

Put two queries in SQL file and provide it to Trino Operator task

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