-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48459][CONNECT][PYTHON] Implement DataFrameQueryContext in Spa…
…rk Connect ### What changes were proposed in this pull request? This PR proposes to Implement DataFrameQueryContext in Spark Connect. 1. Add two new protobuf messages packed together with `Expression`: ```proto message Origin { // (Required) Indicate the origin type. oneof function { PythonOrigin python_origin = 1; } } message PythonOrigin { // (Required) Name of the origin, for example, the name of the function string fragment = 1; // (Required) Callsite to show to end users, for example, stacktrace. string call_site = 2; } ``` 2. Merge `DataFrameQueryContext.pysparkFragment` and `DataFrameQueryContext.pysparkcallSite` to existing `DataFrameQueryContext.fragment` and `DataFrameQueryContext.callSite` 3. Separate `QueryContext` into `SQLQueryContext` and `DataFrameQueryContext` for consistency w/ Scala side 4. Implement the origin logic. `current_origin` thread local holds the current call site/the function name, and `Expression` gets it from it. They are set to individual expression messages, and are used when analysis happens - this resembles Spark SQL implementation. See also #45377. ### Why are the changes needed? See #45377 ### Does this PR introduce _any_ user-facing change? Yes, same as #45377 but in Spark Connect. ### How was this patch tested? Same unittests reused in Spark Connect. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46789 from HyukjinKwon/connect-context. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
- Loading branch information
1 parent
58701d8
commit 80bba44
Showing
19 changed files
with
463 additions
and
205 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.