- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
On (1): the docs don't gate Scala foreachBatch on serverless. Limitations with Databricks Connect for Scala lists streaming foreachBatch as unavailable only on Databricks Runtime 13.3 LTS and below, and serverless limitations names only Trigger.ProcessingTime and Trigger.Continuous as blocked triggers. Serverless Scala and Java JAR jobs are in Public Preview. I'm reading published docs here, not speaking for support.
On (2): I can't find any published Databricks doc or KB that names RST_STREAM or PROTOCOL_ERROR, so I wouldn't put a label on it from out here. One thing worth raising with support: [UDF_ERROR](https://docs.databricks.com/aws/en/error-messages/udf-error-error-class) has a dedicated ENV_LOST sub-condition for an execution environment that was lost mid-run, and you're getting INTERNAL instead. Whether that distinction is meaningful here is a question for whoever picks up the ticket. Your empty no-op result already rules out the merge logic.
On (3), three things before the case:
-
Make sure your application logs are actually being emitted. On serverless, the SLF4J logging API defaults to a no-op backend and application log output is silently discarded unless you add the
log4j-slf4j2-implbridge matching thelog4j-apiversion in your environment version (2.20.0 on environment version 5). See Configure logging for serverless compute. One note on thelog4j.logger.org.apache.spark.sql.connect=DEBUGsuggestion above: Spark logs aren't available on serverless, only client-side application logs, only six Spark properties are settable and none are log4j-related, and changing the log4j level throughSparkContextis listed as unavailable. Use the query profile in place of the Spark UI. -
Match Scala, JDK, and your Spark API dependency to your environment version. You mentioned you're not building against Databricks Connect;
spark-sql-apiis a documented alternative, but Databricks recommendsdatabricks-connectmarkedprovided, so that's worth ruling out. Don't bundlelog4j-apiorlog4j-core. -
Isolate
foreachBatchitself. Swap Kinesis for a small Delta table,Trigger.AvailableNow(), emptyforeachBatch, single-class JAR. Delta is a documented serverless streaming source, so a failure there isolatesforeachBatchcleanly.
If that still fails, it's a clean repro to attach to a support case. On fallback, note that standard access mode also runs on Spark Connect; dedicated compute is the mode that uses the classic Spark architecture.