Skip to content

Commit

Permalink
vdk-plugins: Fix Trino Lineage (#3428)
Browse files Browse the repository at this point in the history
vdk-plugins: Fix Trino Lineage

First collect lineage for Trino if configured,
then execute the statement, otherwise
'explain create as select' fails if the table exists.

---------

Signed-off-by: Tonka Zheleva <[email protected]>

Signed-off-by: Tonka Zheleva <[email protected]>
Co-authored-by: Goran Kokinovski <[email protected]>
  • Loading branch information
gorankokin and Goran Kokinovski authored Nov 8, 2024
1 parent 295092d commit 9a01569
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ def db_connection_recover_operation(self, recovery_cursor: RecoveryCursor) -> No
raise recovery_cursor.get_exception()

def execute_query(self, query):
res = self.execute_query_with_retries(query)
# first evaluate lineage because current behavior of 'explain create as select' fails if the table exists
if self._lineage_logger:
lineage_data = self._get_lineage_data(query)
if lineage_data:
self._lineage_logger.send(lineage_data)
res = self.execute_query_with_retries(query)
if self._lineage_logger and lineage_data:
self._lineage_logger.send(lineage_data)
# TODO: collect lineage for failed query
return res

Expand Down

0 comments on commit 9a01569

Please sign in to comment.