#346 Fix Databricks spatial join: collect() instead of count()#349
Merged
Conversation
…er-level AQE disable, skip OOM experiments - Replace result.count() with result.collect() in both notebooks to prevent Databricks ResultCacheManager from replanning the query as BroadcastNestedLoopJoin (brute-force cross product that exceeds spark.driver.maxResultSize) - Add spark.sql.adaptive.enabled=false and spark.sql.autoBroadcastJoinThreshold=-1 to cluster-level spark_conf - Add skip: true support in benchmark_runner.py — records stop_reason=failed with 0 iterations without provisioning a cluster - Mark partitioned joins at medium/large and PostGIS large as skip: true (executor OOM from RangeJoin spatial index exceeding Standard_D4s_v3 memory)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to the benchmark runner, configuration, and Databricks job execution to better handle out-of-memory (OOM) scenarios and ensure accurate experiment tracking. The main changes include adding the ability to skip problematic experiments, updating cluster and job settings to avoid Spark query plan rewrites, and fixing result collection in Databricks scripts.
Benchmark skipping and experiment tracking:
benchmark_runner.py,benchmarks.yml: Added askipflag to experiments inbenchmarks.ymland logic inbenchmark_runner.pyto detect and record skipped experiments, preventing OOM-prone benchmarks from running and ensuring metadata is saved with aFAILEDstop reason. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Databricks cluster and Spark settings:
src/infra/infrastructure/services/databricks_service.py: Disabled Spark Adaptive Query Execution (AQE) and automatic broadcast join threshold at the cluster level to prevent runtime query plan rewrites that could cause instability in spatial join jobs.Databricks result collection fix:
src/presentation/databricks/national_scale_spatial_join_broadcast.py,src/presentation/databricks/national_scale_spatial_join_partitioned.py: Changed from usingresult.count()to collecting results and usinglen(collected)to ensure accurate cardinality measurement and avoid possible Spark execution issues. [1] [2]