-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Unnest supports multiple parameters of different types #12484
Conversation
starrocks_be_unittest succeeded. |
starrocks_be_unittest succeeded. |
starrocks_be_unittest succeeded. |
@@ -49,8 +54,7 @@ public TableFunction(FunctionName fnName, List<String> defaultColumnNames, List< | |||
|
|||
public static void initBuiltins(FunctionSet functionSet) { | |||
TableFunction unnestFunction = new TableFunction(new FunctionName("unnest"), Lists.newArrayList("unnest"), | |||
Lists.newArrayList(Type.ANY_ARRAY), Lists.newArrayList(Type.ANY_ELEMENT)); | |||
|
|||
Lists.newArrayList(Type.ANY_ARRAY), Lists.newArrayList(Type.ANY_ELEMENT), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line 91 of Function.java, there is a todo like TODO: we don't currently support varargs with no fixed types. i.e. fn(...)
. Can this todo be removed after this pr merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that comment is for scalar function, and scalar function does not currently support multi-type case.
fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeLateralTest.java
Show resolved
Hide resolved
BE Build Success |
fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/sql/analyzer/QueryAnalyzer.java
Outdated
Show resolved
Hide resolved
BE Build Success |
Kudos, SonarCloud Quality Gate passed! |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
run starrocks_fe_unittest |
[FE PR Coverage Check]😍 pass : 55 / 56 (98.21%) file detail
|
run starrocks_admit_test |
[Feature] Unnest supports multiple parameters of different types #12484 unnest支持多列展开 ``` select * from tb1; +------+-------------------+-------------------+ | id | type1 | type2 | +------+-------------------+-------------------+ | id1 | typeA;typeB;typeC | type1;type2;type3 | +------+-------------------+-------------------+ select id, t1.v1, t1.v2 from tb1, unnest(split(type1, ";"), split(type2, ";")) as t1(v1, v2); +------+-------+-------+ | id | v1 | v2 | +------+-------+-------+ | id1 | typeA | type1 | | id1 | typeB | type2 | | id1 | typeC | type3 | +------+-------+-------+ ```
What type of PR is this:
Which issues of this PR fixes :
Fixes #
Problem Summary(Required) :
The Unnest function supports multiple parameters, and the lengths of multiple arrays in unnest may not be equal. When there is an unequal situation, the columns expanded by the few arrays are supplemented with NULL values.
https://github.com/StarRocks/StarRocksTest/pull/1354
Checklist: