[
https://issues.apache.org/jira/browse/CALCITE-6071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17779259#comment-17779259
]
Julian Hyde commented on CALCITE-6071:
--------------------------------------
I would add position (or indeed an error message that contains a position) as
an argument to a {{RexCall}}, if and only if the function can throw.
I would not add a position field to {{RexNode}}. That would create a storm of
position information, 99% of which is useless.
> RexNode should carry source position information for runtime error reporting
> ----------------------------------------------------------------------------
>
> Key: CALCITE-6071
> URL: https://issues.apache.org/jira/browse/CALCITE-6071
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.35.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> Currently runtime errors, such as division by zero, cannot report the
> position in the original source code where the original operator was. RexNode
> does not carry such information. By adding the required information in
> RexNode we can report much better runtime errors to users.
> Here is an additional comment from [~jhyde] on the dev mailing list:
> The RexCall to such throwable functions would have a hidden ‘pos’ parameter.
> The parameter should be populated at Sql-to-rel time, and if it is not
> present, SqlOperator.validareRexOperands should throw. Associating the
> position with the particular function call seems to me much more robust than
> associating it with the RelNode that contains the call.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)