linrrzqqq commented on code in PR #66968:
URL: https://github.com/apache/doris/pull/66968#discussion_r3892641388


##########
fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -1648,7 +1682,9 @@ lambdaExpression
     | LEFT_PAREN
         args+=errorCapturingIdentifier (COMMA args+=errorCapturingIdentifier)+
       RIGHT_PAREN
-        ARROW body=booleanExpression
+        ARROW ({isTupleLambdaBody()}?

Review Comment:
   原先是不支持这个语法糖的
   ```text
   Doris> select array_map((k, v) -> (k + 1, v + 1), [1], [1]);
   、ERROR 1105 (HY000): errCode = 2, detailMessage = 
   missing ')' at ','(line 1, pos 33)
   
   Doris> select array_map((k, v) -> struct(k + 1, v + 1), [1], [1]);
   +-----------------------------------------------------+
   | array_map((k, v) -> struct(k + 1, v + 1), [1], [1]) |
   +-----------------------------------------------------+
   | [{"col1":2, "col2":2}]                              |
   +-----------------------------------------------------+
   ```
   
   测了下,性能稳定劣化, 可能没支持的必要?
   SQL 场景 | 无 predicate | 当前 predicate | 变化
   -- | -- | -- | --
   单个 tuple lambda | 23.749 μs/op | 25.153 μs/op | 慢 5.91%
   32 个 tuple lambda | 679.133 μs/op | 697.665 μs/op | 慢 2.73%
   单个括号普通表达式 | 20.621 μs/op | 20.734 μs/op | 慢 0.55%
   32 个括号普通表达式 | 572.181 μs/op | 575.088 μs/op | 慢 0.51%
   32 个普通表达式 | 336.354 μs/op | 338.058 μs/op | 慢 0.51%
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to