-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50031][SQL][FOLLOW-UP] Add tests for
try_parse_url
in the co…
…nnect module ### What changes were proposed in this pull request? Add tests in `PlanGenerationTestSuite` for `try_parse_url` function introduced in [this](#48500) PR and generate the corresponding golden files. ### Why are the changes needed? The added tests ensure the new function behaves as expected. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Tests added. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48637 from jovanm-db/goldenFiles. Authored-by: Jovan Markovic <[email protected]> Signed-off-by: Max Gekk <[email protected]>
- Loading branch information
Showing
7 changed files
with
74 additions
and
0 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
2 changes: 2 additions & 0 deletions
2
...nect/common/src/test/resources/query-tests/explain-results/function_try_parse_url.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Project [parse_url(g#0, g#0, false) AS try_parse_url(g, g)#0] | ||
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0] |
2 changes: 2 additions & 0 deletions
2
...on/src/test/resources/query-tests/explain-results/function_try_parse_url_with_key.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Project [parse_url(g#0, g#0, g#0, false) AS try_parse_url(g, g, g)#0] | ||
+- LocalRelation <empty>, [id#0L, a#0, b#0, d#0, e#0, f#0, g#0] |
29 changes: 29 additions & 0 deletions
29
sql/connect/common/src/test/resources/query-tests/queries/function_try_parse_url.json
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"common": { | ||
"planId": "1" | ||
}, | ||
"project": { | ||
"input": { | ||
"common": { | ||
"planId": "0" | ||
}, | ||
"localRelation": { | ||
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e" | ||
} | ||
}, | ||
"expressions": [{ | ||
"unresolvedFunction": { | ||
"functionName": "try_parse_url", | ||
"arguments": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "g" | ||
} | ||
}, { | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "g" | ||
} | ||
}] | ||
} | ||
}] | ||
} | ||
} |
Binary file added
BIN
+189 Bytes
sql/connect/common/src/test/resources/query-tests/queries/function_try_parse_url.proto.bin
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
...onnect/common/src/test/resources/query-tests/queries/function_try_parse_url_with_key.json
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"common": { | ||
"planId": "1" | ||
}, | ||
"project": { | ||
"input": { | ||
"common": { | ||
"planId": "0" | ||
}, | ||
"localRelation": { | ||
"schema": "struct\u003cid:bigint,a:int,b:double,d:struct\u003cid:bigint,a:int,b:double\u003e,e:array\u003cint\u003e,f:map\u003cstring,struct\u003cid:bigint,a:int,b:double\u003e\u003e,g:string\u003e" | ||
} | ||
}, | ||
"expressions": [{ | ||
"unresolvedFunction": { | ||
"functionName": "try_parse_url", | ||
"arguments": [{ | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "g" | ||
} | ||
}, { | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "g" | ||
} | ||
}, { | ||
"unresolvedAttribute": { | ||
"unparsedIdentifier": "g" | ||
} | ||
}] | ||
} | ||
}] | ||
} | ||
} |
Binary file added
BIN
+196 Bytes
...t/common/src/test/resources/query-tests/queries/function_try_parse_url_with_key.proto.bin
Binary file not shown.