admin管理员组文章数量:1355570
I have a table in Snowflake that tracks newly added items, and a downstream data processing workflow that needs to be triggered whenever new items are added. I'm currently using Lakehouse Federation to query the Snowflake tables in Databricks.
How can I set up a mechanism to trigger the downstream data processing step with the newly added items? For example, if table X in Snowflake receives a new insert with item_id = 84848, the workflow should be triggered to run analysis based on this item_id. The trigger can be either interval-based or event-driven.
What would be the best approach to implement this in databricks?
I have a table in Snowflake that tracks newly added items, and a downstream data processing workflow that needs to be triggered whenever new items are added. I'm currently using Lakehouse Federation to query the Snowflake tables in Databricks.
How can I set up a mechanism to trigger the downstream data processing step with the newly added items? For example, if table X in Snowflake receives a new insert with item_id = 84848, the workflow should be triggered to run analysis based on this item_id. The trigger can be either interval-based or event-driven.
What would be the best approach to implement this in databricks?
Share Improve this question edited Mar 29 at 17:28 user19192927 asked Mar 29 at 17:25 user19192927user19192927 353 bronze badges1 Answer
Reset to default 0Will you be able to come up with a SQL query that returns only the new rows/items added? If so You can refer this doc to read data from a Databricks spark job using a query.
https://docs.snowflake/en/user-guide/spark-connector-use#using-the-connector-in-scala
val df = sparkSession.read.format(SNOWFLAKE_SOURCE_NAME)
.options(sfOptions)
.option("query", query)
.option("autopushdown", "off")
.load()
val df: DataFrame = sqlContext.read
.format(SNOWFLAKE_SOURCE_NAME)
.options(sfOptions)
.option("query", "SELECT DEPT, SUM(SALARY) AS SUM_SALARY FROM T1")
.load()
本文标签: Triggering Downstream Workflow in Databricks from New Inserts in SnowflakeStack Overflow
版权声明:本文标题:Triggering Downstream Workflow in Databricks from New Inserts in Snowflake - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744009388a2575284.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论