Hi! Did anyone could make make the Spark-Lineage w...
# ingestion
l
Hi! Did anyone could make make the Spark-Lineage work on Databricks? I added the dependency on my cluster but I get the following when running a job
Copy code
Caused by: java.lang.ClassNotFoundException: com.linkedin.datahub.lineage.spark.interceptor.DatahubLineageEmitter
Does anyone know if there is anything special to do when running on databricks?
b
Hey there! I'm not sure anyone has actually tried to run this on Databricks (yet). Is there a way to ensure that the DataHub JAR is on the classpath in Databricks?
It seems that it is not
m
Hey @limited-cricket-18852: we haven't yet published the jars to the central repo. Targeting to get it there this week.
b
^^^
answers it i guess šŸ˜„
m
Will update this thread once we have a public artifact to test with!
Unless you are building the jar locally and dropping it onto your application
l
indeed, we are building the jar locally and upload it on the Cluster as dependency
and we even tried to add it as dependency to our app (in the fat jar)
m
@dazzling-judge-80093: do you have any ideas here?
d
I don’t know how it works on databricks but normally you can specify additional jars with the
--jars
option on
spark-submit
pyspark/etc… -> https://spark.apache.org/docs/latest/submitting-applications.html#advanced-dependency-management
I think this url can be dbfs/S3/ABFS url as well
or it can be an http(s) url as well
Here is a simple example which I just tried with postgres jar for the example:
Copy code
spark-sql --master "local[2]" --jars <https://jdbc.postgresql.org/download/postgresql-42.3.1.jar>
l
I have been using the UI to submit a spark job on databricks for quick tests, and we have to upload the jar on the cluster directly
I will then tests soon with the
--jars
params then
thanks!
@dazzling-judge-80093 Hello šŸ‘‹ , I am not a spark expert (yet?) and am wondering if
spark.jars.packages io.acryl:spark-lineage:0.0.1
will make the spark cluster to automatically pull and install the jar from the maven-central?
d
I think it should if it is published to maven center but currently it is not as far as I know
l
šŸŽ‰ 🄳 ā¤ļø thanks to your all! I will try it as soon as I can
m
@limited-cricket-18852: 0.0.1 might be dead on arrival.. will let you know once we have a lib version that works!
l
ok I see, thanks!
m
@limited-cricket-18852:
0.0.2
is here.
Copy code
<https://repo1.maven.org/maven2/io/acryl/datahub-spark-lineage/0.0.2/>
https://datahubproject.io/docs/spark-lineage/
l
awesome, thank you ! I still get this
Copy code
java.lang.ClassNotFoundException: com.linkedin.datahub.lineage.spark.interceptor.DatahubLineageEmitter
But I just noticed that this library supports 2.x while I am using 3.x. I will try to make a build upgrading the spark dependency and see how it goes.
d
How did you specified the jar? This error message says Spark can’t find the Emitter class which should come from the jar and this error I think is not a spark 2 vs 3 related error.
l
as specified int he documentation I added the following configuration to my Cluster:
Copy code
spark.jars.packages                          io.acryl:datahub-spark-lineage:0.0.2
spark.extraListeners                         com.linkedin.datahub.lineage.spark.interceptor.DatahubLineageEmitter
spark.datahub.lineage.mcpEmitter.gmsUrl      <http://localhost:8080>
If this knows to look for the DatahubLineageEmitter, it means that it correctly parsed the
spark.extraListeners
parameter. But it would not find the class either: • setting the configuration
spark.jars.packages
• adding the jar to the job (fat jar) • uploading the jar to the cluster (databricks has a special UI for this)
I must be missing something somewhere in the way to add a dependency when using Databricks maybe
d
Do you see any other error during startup or only the class not found exception is what you see?
l
unfortunately I do not get any error or ā€œstrangeā€ log before this stacktrace
l
@careful-pilot-86309 can you please take a look? ^
c
Are you using databricks? We have not tested it with databricks yet.
We are planning to test with databricks soon.
l
Thank you! I will be off for a couple of weeks, and I will then make more tests.