xiedeyantu commented on code in PR #4690:
URL: https://github.com/apache/calcite/pull/4690#discussion_r2625031880
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java:
##########
@@ -2401,9 +2401,15 @@ public class SqlStdOperatorTable extends
ReflectiveSqlOperatorTable {
SqlCall call,
int leftPrec,
int rightPrec) {
- final SqlWriter.Frame frame = writer.startList("(", ")");
- call.operand(0).unparse(writer, 0, 0);
- writer.endList(frame);
+ final SqlNode operand = call.operand(0);
+ if (operand.getKind() == SqlKind.SELECT) {
+ operand.unparse(writer, leftPrec, rightPrec);
+ } else {
+ final SqlWriter.Frame frame =
Review Comment:
Yes, this test can run into
else([link](https://github.com/apache/calcite/blob/f19e854c39e5a43aea2323e455229bd8dfc6dcdb/core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java#L6372)).
```
WHEN 0 THEN NULL WHEN 1 THEN MIN(`product_class_id`) ELSE (SELECT NULL
UNION ALL
SELECT NULL) END AS `$f0`
```
--
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]