[VL][TEST] Use spark.execution.id to replace the velox's queryId#12248
Open
JkSelf wants to merge 1 commit into
Open
[VL][TEST] Use spark.execution.id to replace the velox's queryId#12248JkSelf wants to merge 1 commit into
JkSelf wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR wires Spark SQL’s spark.sql.execution.id from the JVM side into the native runtime via JNI, and uses it in the Velox backend to label query/task identifiers (intended to replace the prior Velox queryId based on stage/task IDs).
Changes:
- Add
executionIdto the JNInativeCreateKernelWithIteratorpath and propagate it intoSparkTaskInfo. - Read
spark.sql.execution.idfromTaskContextlocal properties inNativePlanEvaluatorand pass it to native. - Update Velox-side identifier construction to prefer
executionIdwhen present.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gluten-arrow/src/main/java/org/apache/gluten/vectorized/PlanEvaluatorJniWrapper.java | Extends native iterator-kernel creation signature with executionId. |
| gluten-arrow/src/main/java/org/apache/gluten/vectorized/NativePlanEvaluator.java | Extracts Spark SQL execution id from TaskContext and forwards it to JNI. |
| cpp/core/jni/JniWrapper.cc | Accepts executionId in JNI entrypoint and stores it in SparkTaskInfo. |
| cpp/core/compute/Runtime.h | Adds executionId to SparkTaskInfo and includes it in toString(). |
| cpp/velox/compute/WholeStageResultIterator.cc | Uses executionId to form Velox identifiers (task/query context ids). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+75
to
+86
| namespace { | ||
| std::string getVeloxTaskId(const SparkTaskInfo& taskInfo) { | ||
| if (taskInfo.executionId != -1) { | ||
| return fmt::format("Gluten_Execution_{}", std::to_string(taskInfo.executionId)); | ||
| } | ||
| return fmt::format( | ||
| "Gluten_Stage_{}_TID_{}_VTID_{}", | ||
| std::to_string(taskInfo.stageId), | ||
| std::to_string(taskInfo.taskId), | ||
| std::to_string(taskInfo.vId)); | ||
| } | ||
| } // namespace |
Comment on lines
243
to
246
| memoryManager_->getAggregateMemoryPool(), | ||
| spillExecutor_, | ||
| fmt::format( | ||
| "Gluten_Stage_{}_TID_{}_VTID_{}", | ||
| std::to_string(taskInfo_.stageId), | ||
| std::to_string(taskInfo_.taskId), | ||
| std::to_string(taskInfo_.vId))); | ||
| getVeloxTaskId(taskInfo_)); | ||
| return ctx; |
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.
What changes are proposed in this pull request?
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?