Hello everyone. I'm excited about the potential of...
# ingestion
i
Hello everyone. I'm excited about the potential of DataHub. I successfully ran ingestion from glue but find no lineage for most of our jobs. The curious thing is that under Platforms, I see two boxes: Glue with 315 objects and S3 with 4. Only the ones listed as S3 give me lineage. None of the Glue jobs do. All our sources and targets are in S3. Is there a setting or config required to extract lineage from Glue jobs? Any hints would be apprecaited.
b
Hi @important-camera-38424! Looking into this on our side.. Should have an update soon
m
Thanks @big-carpet-38439. @important-camera-38424 will update this thread soon.
thank you 1
c
Hi @important-camera-38424! Looking into this now. What kind of lineage are you expecting? When you mention that you see lineage in S3, can you send a screenshot of what that looks like?
i
Thanks for reaching out. Here's an example of what I'd expect.
Most of our Glue jobs show no lineage.
For Redshift, we get lineage without an issue as well:
c
Interesting… does there seem to be a difference between the jobs that have lineage vs. those that don’t?
Also, are you defining your data jobs via a custom Python script or are you constructing them using Glue studio?
i
They are custom PySpark jobs
You may be on to something. Perhaps the four that show lineage were made in Glue Studio.
If so, do you know if there is a way to get the custom jobs to behave?
c
Ah so this is a known caveat with Glue – their API for getting lineage only works if you’ve constructed the script using the GUI. As far as we know there’s no way around this limitation
Thanks for bringing this up though – we’ll make a note in the docs to save people time from debugging
i
Ah. OK. Bummer. And you're sure there is no way to adjust or add to our PySpark jobs to get lineage?
c
Don’t think it’s possible through Glue unfortunately
If Spark has a lineage API we could look into making a connecter though!
i
That would be cool, although it's not clear to me how that would work. There is this: hadoop - What is Lineage In Spark? - Stack Overflow
👀 1
@chilly-holiday-80781: Thanks again for your attention to this issue. I went ahead and created a simple job in the Glue UI and still got no lineage. The new table showed up as did the job, but no lineage.
c
Oh that’s unexpected then, can you share what kind of job you created?
Can also take this to DMs if you’d like
i
It's a very simple job that moves data from one S3 bucket to another and drops a column along the way.
Would have expected a source and target to show up in the lineage in DataHub, but no such luck.
In DataHub, I get schema and properties but no lineage:
a
Following this thread as I also work with Glue + Custom PySpark scripts 🙂
b
Cc @chilly-holiday-80781
i
Update: A fix was released to pull lineage but only from annotation. The annotation is no longer generated in Glue Studio unless you toggle to "Generate Classic Script". For custom PySpark code, you would have to write up the annotation manually. Here's the update made by a DataHub team member: https://github.com/linkedin/datahub/pull/3555/files
I have asked AWS whether they intend to make their API independent of annotation. As it currently stands, the API is essentially defunct unless you keep toggeling in the UI to "Generate Classic Scripts" Who does that? https://docs.aws.amazon.com/glue/latest/webapi/API_GetDataflowGraph.html
a
Hi @best-carpenter-16586 thanks for the update! i did a quick test to see if this would work with my custom script, i only used 2 annotations: 1st: to annotate source bucket
Copy code
## @type: DataSource
## @args: [connection_type = "s3", format = "parquet", connection_options = {"paths": ["<s3://xxx/xxx/>"], "recurse":True}, transformation_ctx = "DataSource0"]
## @return: DataSource0
## @inputs: []
2nd: to annotate my target bucket
Copy code
## @type: DataSink
## @args: [format_options = {"compression": "snappy"}, connection_type = "s3", format = "parquet", connection_options = {"path": "<s3://yyy/yyy>"}, transformation_ctx = "DataSink0"]
## @return: DataSink0
## @inputs: [frame = DataSource0]
the glue script looks like this
then when running the ingestion i can see this output
but the UI shows the
lineage
button as disable...did you manage to run a basic example of
source>target
lineage in a custom script in AWS Glue?
i ran another test build ing a script from glue studio, (very basic) and i can see the lineage finally, i guess i might need to work with
custom_Transformation
annotations to achieve the end goal, however most of my source data is coming from NoSQL db's (a lot of nested arrays) so might be time consuming to try & error the annotations aws provides you out of the box..i'll keep you guys posted