Seaven commented on a change in pull request #2979: Incomplete support Array
type (#2871)
URL: https://github.com/apache/incubator-doris/pull/2979#discussion_r386768258
##########
File path: fe/src/main/java/org/apache/doris/rewrite/FEFunctions.java
##########
@@ -421,4 +422,21 @@ public static LiteralExpr ifNullBigInt(LiteralExpr first,
LiteralExpr second) th
public static LiteralExpr ifNullDateTime(LiteralExpr first, LiteralExpr
second) throws AnalysisException {
return first instanceof NullLiteral ? second : first;
}
+
+ /**
+
------------------------------------------------------------------------------
+ */
+
+ /**
+ * Nest type function
+ */
+ @FEFunction(name = "array", argTypes = {"INT"}, returnType = "ARRAY")
+ public static LiteralExpr arrayInt(LiteralExpr... exprs) throws
AnalysisException {
+ return new ArrayLiteral(exprs);
+ }
+
+ @FEFunction(name = "array", argTypes = {"VARCHAR"}, returnType = "ARRAY")
+ public static LiteralExpr array(StringLiteral... exprs) throws
AnalysisException {
Review comment:
Em...the method is same with array(IntLiteral.....) in fact, maybe will same
with array(BigintLiteral.....)、array(BoolLiteral.....) in future......I think
better way is refactor the annotation for support a list of types
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]