[
https://issues.apache.org/jira/browse/CALCITE-6708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17901577#comment-17901577
]
Mihai Budiu commented on CALCITE-6708:
--------------------------------------
This particular exception happens because the parser accepts TRIM(), although
this is not legal according to the function syntax. So maybe this is only a bug
related to the TRIM function, which can end up having NULL values in the
operands list?
> SqlNode.toString can throw
> --------------------------
>
> Key: CALCITE-6708
> URL: https://issues.apache.org/jira/browse/CALCITE-6708
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.38.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> Currently SqlNode.toString() calls toSqlString, which can throw if the SQL is
> incorrect.
> This makes toString less useful for debugging and logging.
> For example, the query `SELECT TRIM()` is parsed but cannot be converted back
> to a String, because SqlTrimFunction.unparse attempts to access a null
> operand.
> I am not sure this can be fixed easily.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)