<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic spline agent in Databricks use in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/spline-agent-in-databricks-use/m-p/57416#M30772</link>
    <description>&lt;P&gt;&lt;STRONG&gt;spline Agent&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;I use spline agent to get lineage of Databricks notebooks&amp;nbsp;&lt;/P&gt;&lt;P&gt;and for that i put the following code - attached to the notebook&amp;nbsp;&lt;BR /&gt;But i get the error attached&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;%scala&lt;BR /&gt;import scala.util.parsing.json.JSON&lt;BR /&gt;import za.co.absa.spline.harvester.SparkLineageInitializer._&lt;BR /&gt;import za.co.absa.spline.agent.AgentConfig&lt;BR /&gt;import za.co.absa.spline.harvester.postprocessing.AbstractPostProcessingFilter&lt;BR /&gt;import za.co.absa.spline.harvester.postprocessing.PostProcessingFilter&lt;BR /&gt;import org.apache.commons.configuration.Configuration&lt;BR /&gt;import za.co.absa.spline.harvester.conf.StandardSplineConfigurationStack&lt;BR /&gt;import za.co.absa.spline.harvester.HarvestingContext&lt;BR /&gt;import za.co.absa.spline.producer.model.ExecutionPlan&lt;BR /&gt;import za.co.absa.spline.producer.model.ExecutionEvent&lt;BR /&gt;import za.co.absa.spline.producer.model.ReadOperation&lt;BR /&gt;import za.co.absa.spline.producer.model.WriteOperation&lt;BR /&gt;import za.co.absa.spline.producer.model.DataOperation&lt;BR /&gt;import za.co.absa.spline.harvester.ExtraMetadataImplicits._&lt;BR /&gt;import za.co.absa.spline.harvester.SparkLineageInitializer._&lt;/P&gt;&lt;P&gt;val notebookInformationJson = dbutils.notebook.getContext.toJson&lt;BR /&gt;val outerMap = JSON.parseFull(notebookInformationJson).getOrElse(0).asInstanceOf[Map[String,String]]&lt;BR /&gt;val tagMap = outerMap("tags").asInstanceOf[Map[String,String]]&lt;BR /&gt;val extraContextMap = outerMap("extraContext").asInstanceOf[Map[String,String]]&lt;BR /&gt;val notebookPath = extraContextMap("notebook_path").split("/")&lt;BR /&gt;//val workspaceUrl=tagMap("browserHostName")&lt;BR /&gt;var workspaceUrl="&lt;A href="https://adb-7614304971745696.16.azuredatabricks.net" target="_blank"&gt;https://adb-7614304971745696.16.azuredatabricks.net&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;val workspaceName=dbutils.notebook().getContext().notebookPath.get&lt;BR /&gt;val notebookURL = tagMap("browserHostName")+"/?o="+tagMap("orgId")&lt;BR /&gt;val user = tagMap("user")&lt;BR /&gt;val name = notebookPath(notebookPath.size-1)&lt;BR /&gt;val notebookInfo = Map("notebookURL" -&amp;gt; notebookURL,&lt;BR /&gt;"user" -&amp;gt; user,&lt;BR /&gt;"workspaceName" -&amp;gt;workspaceName,&lt;BR /&gt;"workspaceUrl" -&amp;gt; workspaceUrl,&lt;BR /&gt;"name" -&amp;gt; name,&lt;BR /&gt;"mounts" -&amp;gt; dbutils.fs.ls("/FileStore/tables").map(_.path),&lt;BR /&gt;"timestamp" -&amp;gt; System.currentTimeMillis)&lt;BR /&gt;val notebookInfoJson = scala.util.parsing.json.JSONObject(notebookInfo)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class CustomFilter extends PostProcessingFilter {&lt;BR /&gt;def this(conf: Configuration) = this()&lt;/P&gt;&lt;P&gt;override def processExecutionEvent(event: ExecutionEvent, ctx: HarvestingContext): ExecutionEvent =&lt;BR /&gt;event.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processExecutionPlan(plan: ExecutionPlan, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ExecutionPlan =&lt;BR /&gt;plan.withAddedExtra(Map( "notebookInfo" -&amp;gt; notebookInfoJson))&lt;/P&gt;&lt;P&gt;override def processReadOperation(op: ReadOperation, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ReadOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processWriteOperation(op: WriteOperation, ctx: HarvestingContext): WriteOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processDataOperation(op: DataOperation, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; DataOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;val myInstance = new CustomFilter()&lt;/P&gt;&lt;P&gt;spark.enableLineageTracking(&lt;BR /&gt;AgentConfig.builder()&lt;BR /&gt;.postProcessingFilter(myInstance)&lt;BR /&gt;.build()&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 07:54:29 GMT</pubDate>
    <dc:creator>ZacayDaushin</dc:creator>
    <dc:date>2024-01-16T07:54:29Z</dc:date>
    <item>
      <title>spline agent in Databricks use</title>
      <link>https://community.databricks.com/t5/data-engineering/spline-agent-in-databricks-use/m-p/57416#M30772</link>
      <description>&lt;P&gt;&lt;STRONG&gt;spline Agent&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;I use spline agent to get lineage of Databricks notebooks&amp;nbsp;&lt;/P&gt;&lt;P&gt;and for that i put the following code - attached to the notebook&amp;nbsp;&lt;BR /&gt;But i get the error attached&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;%scala&lt;BR /&gt;import scala.util.parsing.json.JSON&lt;BR /&gt;import za.co.absa.spline.harvester.SparkLineageInitializer._&lt;BR /&gt;import za.co.absa.spline.agent.AgentConfig&lt;BR /&gt;import za.co.absa.spline.harvester.postprocessing.AbstractPostProcessingFilter&lt;BR /&gt;import za.co.absa.spline.harvester.postprocessing.PostProcessingFilter&lt;BR /&gt;import org.apache.commons.configuration.Configuration&lt;BR /&gt;import za.co.absa.spline.harvester.conf.StandardSplineConfigurationStack&lt;BR /&gt;import za.co.absa.spline.harvester.HarvestingContext&lt;BR /&gt;import za.co.absa.spline.producer.model.ExecutionPlan&lt;BR /&gt;import za.co.absa.spline.producer.model.ExecutionEvent&lt;BR /&gt;import za.co.absa.spline.producer.model.ReadOperation&lt;BR /&gt;import za.co.absa.spline.producer.model.WriteOperation&lt;BR /&gt;import za.co.absa.spline.producer.model.DataOperation&lt;BR /&gt;import za.co.absa.spline.harvester.ExtraMetadataImplicits._&lt;BR /&gt;import za.co.absa.spline.harvester.SparkLineageInitializer._&lt;/P&gt;&lt;P&gt;val notebookInformationJson = dbutils.notebook.getContext.toJson&lt;BR /&gt;val outerMap = JSON.parseFull(notebookInformationJson).getOrElse(0).asInstanceOf[Map[String,String]]&lt;BR /&gt;val tagMap = outerMap("tags").asInstanceOf[Map[String,String]]&lt;BR /&gt;val extraContextMap = outerMap("extraContext").asInstanceOf[Map[String,String]]&lt;BR /&gt;val notebookPath = extraContextMap("notebook_path").split("/")&lt;BR /&gt;//val workspaceUrl=tagMap("browserHostName")&lt;BR /&gt;var workspaceUrl="&lt;A href="https://adb-7614304971745696.16.azuredatabricks.net" target="_blank"&gt;https://adb-7614304971745696.16.azuredatabricks.net&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;val workspaceName=dbutils.notebook().getContext().notebookPath.get&lt;BR /&gt;val notebookURL = tagMap("browserHostName")+"/?o="+tagMap("orgId")&lt;BR /&gt;val user = tagMap("user")&lt;BR /&gt;val name = notebookPath(notebookPath.size-1)&lt;BR /&gt;val notebookInfo = Map("notebookURL" -&amp;gt; notebookURL,&lt;BR /&gt;"user" -&amp;gt; user,&lt;BR /&gt;"workspaceName" -&amp;gt;workspaceName,&lt;BR /&gt;"workspaceUrl" -&amp;gt; workspaceUrl,&lt;BR /&gt;"name" -&amp;gt; name,&lt;BR /&gt;"mounts" -&amp;gt; dbutils.fs.ls("/FileStore/tables").map(_.path),&lt;BR /&gt;"timestamp" -&amp;gt; System.currentTimeMillis)&lt;BR /&gt;val notebookInfoJson = scala.util.parsing.json.JSONObject(notebookInfo)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class CustomFilter extends PostProcessingFilter {&lt;BR /&gt;def this(conf: Configuration) = this()&lt;/P&gt;&lt;P&gt;override def processExecutionEvent(event: ExecutionEvent, ctx: HarvestingContext): ExecutionEvent =&lt;BR /&gt;event.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processExecutionPlan(plan: ExecutionPlan, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ExecutionPlan =&lt;BR /&gt;plan.withAddedExtra(Map( "notebookInfo" -&amp;gt; notebookInfoJson))&lt;/P&gt;&lt;P&gt;override def processReadOperation(op: ReadOperation, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ReadOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processWriteOperation(op: WriteOperation, ctx: HarvestingContext): WriteOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;/P&gt;&lt;P&gt;override def processDataOperation(op: DataOperation, ctx: HarvestingContext &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; DataOperation =&lt;BR /&gt;op.withAddedExtra(Map("foo" -&amp;gt; "bar"))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;val myInstance = new CustomFilter()&lt;/P&gt;&lt;P&gt;spark.enableLineageTracking(&lt;BR /&gt;AgentConfig.builder()&lt;BR /&gt;.postProcessingFilter(myInstance)&lt;BR /&gt;.build()&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 07:54:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spline-agent-in-databricks-use/m-p/57416#M30772</guid>
      <dc:creator>ZacayDaushin</dc:creator>
      <dc:date>2024-01-16T07:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: spline agent in Databricks use</title>
      <link>https://community.databricks.com/t5/data-engineering/spline-agent-in-databricks-use/m-p/64760#M32650</link>
      <description>&lt;P&gt;Could be me&amp;nbsp; but I do not see an error message?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 08:34:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spline-agent-in-databricks-use/m-p/64760#M32650</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-03-27T08:34:05Z</dc:date>
    </item>
  </channel>
</rss>

