Spark.sql.Adaptive.Semabled Work Spark结构化流?

发布于 2025-01-25 13:46:30 字数 130 浏览 4 评论 0 原文

我使用Apache Spark结构化流。结构化流是建立在Spark SQL发动机上的可扩展且耐故障的流处理引擎。由于它建立在Spark SQL引擎上,这是否表示Spark.SQL.Adaptive.Semabled为Spark结构化流媒体作品吗?

I work with Apache Spark Structured Streaming. Structured Streaming is a scalable and fault-tolerant stream processing engine built on the Spark SQL engine. Since It builds on the Spark SQL engine, does it mean spark.sql.adaptive.enabled works for Spark Structured Streaming?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三生殊途 2025-02-01 13:46:30

它在Spark Code中被禁用 - 请参阅 streamExecution

// Adaptive execution can change num shuffle partitions, disallow
sparkSessionForStream.conf.set(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, "false")

原因是因为它在流上有状态时可能会导致问题(添加了此限制的更多详细信息 - spark-19873 )。

如果您仍然想为火花结构化流启用它(例如,如果您确定它不会在用例中造成任何损害),则可以通过设置 foreachBatch 方法在内部执行此操作。 batchdf.sparksession.conf.set(sqlconf.adaptive_execution_enabled.key,“ true”) - 这将覆盖禁用它的SPARK代码。

It's disabled in Spark code - See in StreamExecution:

// Adaptive execution can change num shuffle partitions, disallow
sparkSessionForStream.conf.set(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, "false")

The reason for that is because it might cause issues when having state on the stream (more details in the ticket that added this restriction - SPARK-19873 ).

If you still want to enable it for the Spark Structured Streaming (e.g. if you are sure that it won't cause any harm in your use case), you can do that inside the foreachBatch method, by setting batchDF.sparkSession.conf.set(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, "true") - this will override the Spark code which disabled it.

阪姬 2025-02-01 13:46:30

否。火花/最新/spark-sql/aqe.html 。不支持不流行,不适用于AQE。

想一想状态,理想情况下,小型数据集。火花结构化流中的许多限制。

No. Stated in this doc https://docs.databricks.com/spark/latest/spark-sql/aqe.html. Non-streaming not supported, does not apply for AQE.

Think of statefulness, small datasets ideally. Many restrictions in Spark Structured Streaming.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文