damp-solstice-31196
02/21/2024, 1:19 PMgray-ocean-32209
02/21/2024, 5:50 PMredshift or redshift-legacy
redshift connect extract lineage from CREATE statements when include_table_lineage:true (default it true)
what option you are using for lineage collector table_lineage_mode , best one to use mixed. Possible value [stl_scan_based, sql_based, mixed]
Make sure metadata ingest user as proper access to system tables.
set capture_lineage_query_parser_failures:true to capture lineage query parser errors ingest logsdamp-solstice-31196
02/21/2024, 6:09 PMredshift. We were able to see lineage when we used INSERT INTO statements. But none of the CREATE TABLE statements seemed to be parsed.famous-waitress-64616
02/22/2024, 9:55 PMCREATE TABLE query that you expect to see lineage from? Also note that if you're using temporary tables as part of this process, there's some additional flags you need to add at the momentbig-carpet-38439
02/27/2024, 4:51 PMdamp-solstice-31196
02/27/2024, 10:00 PMDROP TABLE IF EXISTS public.table1;
CREATE TABLE public.table1 AS (
SELECT * FROM public.table2 a LEFT JOIN public.table3 b ON a.id=b.id
);
I won't be able to provide the ingestion logs immediately, I took down that setup a while back. What I can add to this that might be valuable is the following:
1. When I externally dropped the table and then recreated it via its DDL, then used an INSERT INTO query, that worked fine. Datahub was able to parse that and display column-level lineage. I now think it likely would have worked if we only removed the DROP TABLE statement given below point.
2. I also somewhat moved on from this problem since ultimately we wanted to integrate Datahub with our Airflow instance. I've been able to set that up, but am realizing that we will have to split all such DROP/CREATE TABLE ... AS (SELECT ...) queries into separate tasks since the DROP stops Datahub from ingesting the rest of the query when we're using the PostgresOperator.
Sorry if the response is a bit jumbled, hopefully you'll find it interesting and maybe can confirm my hunches about what's going on with Datahub's SQL parser.gray-shoe-75895
02/27/2024, 10:50 PMuse_lineage_v2 enabled in the config? This should generate additional logs and reporting info
The airflow integration currently uses our "raw" sql parser, which can only process sql with a single statement. We're working on a new SqlParsingAggregator interface that handles sequences of queries, but haven't integrated that into airflow yet. Most other warehouses have create or replace table ... as statements, which is why this hasn't cropped up before
pWe have two "layers" of parsers - the rawdamp-solstice-31196
02/28/2024, 2:18 PMuse_lineage_v2 when I have a minutedamp-solstice-31196
02/28/2024, 2:22 PMgray-shoe-75895
03/07/2024, 9:36 PM