Skip to content

Commit

Permalink
control-service: Extending Trino lineage
Browse files Browse the repository at this point in the history
Add lineage for "CREATE AS SELECT"

---------

Signed-off-by: Tonka Zheleva <[email protected]>
  • Loading branch information
gorankokin committed Oct 10, 2024
1 parent 3d97f64 commit 984fa49
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ def _get_lineage_data(self, query):
"ALTER operation not a RENAME TABLE operation. No lineage will be collected."
)

elif statement.get_type() == "SELECT" or statement.get_type() == "INSERT":
elif (
statement.get_type() == "SELECT"
or statement.get_type() == "INSERT"
or (
statement.get_type() == "CREATE" and "select" in statement.value.lower()
)
):
if lineage_utils.is_heartbeat_query(query):
return None
log.debug("Collecting lineage for SELECT/INSERT query ...")
Expand Down

0 comments on commit 984fa49

Please sign in to comment.