-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50081][SQL] Codegen Support for
XPath*
(by Invoke & RuntimeRe…
…placeable) ### What changes were proposed in this pull request? The pr aims to add `Codegen` Support for `xpath*`, include: - `xpath_boolean` - `xpath_short` - `xpath_int` - `xpath_long` - `xpath_float` - `xpath_double` - `xpath_string` - `xpath` ### Why are the changes needed? - improve codegen coverage. - simplified code. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA & Existed UT (eg: `XPathFunctionsSuite`, `XPathExpressionSuite`, `CollationSQLExpressionsSuite`#`*XPath*`, `CollationExpressionWalkerSuite`) ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48610 from panbingkun/xpath_codegen. Lead-authored-by: panbingkun <panbingkun@baidu.com> Co-authored-by: panbingkun <panbingkun@apache.org> Signed-off-by: Max Gekk <max.gekk@gmail.com>
- Loading branch information
Showing
12 changed files
with
162 additions
and
66 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
2 changes: 1 addition & 1 deletion
2
sql/connect/common/src/test/resources/query-tests/explain-results/function_xpath.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath(s#0, a/b/text()) AS xpath(s, a/b/text())#0] | ||
Project [invoke(XPathListEvaluator(a/b/text()).evaluate(s#0)) AS xpath(s, a/b/text())#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...nect/common/src/test/resources/query-tests/explain-results/function_xpath_boolean.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_boolean(s#0, a/b) AS xpath_boolean(s, a/b)#0] | ||
Project [invoke(XPathBooleanEvaluator(a/b).evaluate(s#0)) AS xpath_boolean(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...nnect/common/src/test/resources/query-tests/explain-results/function_xpath_double.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_double(s#0, a/b) AS xpath_double(s, a/b)#0] | ||
Project [invoke(XPathDoubleEvaluator(a/b).evaluate(s#0)) AS xpath_double(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...onnect/common/src/test/resources/query-tests/explain-results/function_xpath_float.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_float(s#0, a/b) AS xpath_float(s, a/b)#0] | ||
Project [invoke(XPathFloatEvaluator(a/b).evaluate(s#0)) AS xpath_float(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
sql/connect/common/src/test/resources/query-tests/explain-results/function_xpath_int.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_int(s#0, a/b) AS xpath_int(s, a/b)#0] | ||
Project [invoke(XPathIntEvaluator(a/b).evaluate(s#0)) AS xpath_int(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...connect/common/src/test/resources/query-tests/explain-results/function_xpath_long.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_long(s#0, a/b) AS xpath_long(s, a/b)#0L] | ||
Project [invoke(XPathLongEvaluator(a/b).evaluate(s#0)) AS xpath_long(s, a/b)#0L] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...nnect/common/src/test/resources/query-tests/explain-results/function_xpath_number.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_number(s#0, a/b) AS xpath_number(s, a/b)#0] | ||
Project [invoke(XPathDoubleEvaluator(a/b).evaluate(s#0)) AS xpath_number(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...onnect/common/src/test/resources/query-tests/explain-results/function_xpath_short.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_short(s#0, a/b) AS xpath_short(s, a/b)#0] | ||
Project [invoke(XPathShortEvaluator(a/b).evaluate(s#0)) AS xpath_short(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
2 changes: 1 addition & 1 deletion
2
...nnect/common/src/test/resources/query-tests/explain-results/function_xpath_string.explain
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Project [xpath_string(s#0, a/b) AS xpath_string(s, a/b)#0] | ||
Project [invoke(XPathStringEvaluator(a/b).evaluate(s#0)) AS xpath_string(s, a/b)#0] | ||
+- LocalRelation <empty>, [d#0, t#0, s#0, x#0L, wt#0] |
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