You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Quesada Lopez (JIRA)" <ji...@apache.org> on 2019/07/04 13:50:00 UTC
[jira] [Commented] (CALCITE-3172) RelBuilder#empty does not keep
aliases
[ https://issues.apache.org/jira/browse/CALCITE-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878670#comment-16878670 ]
Ruben Quesada Lopez commented on CALCITE-3172:
----------------------------------------------
Example of plan that will throw an Exception:
{code}
RelBuilder builder = ...
RexNode myFilter = ... // could be a parameter whose value we do not know beforehand
builder
.scan("DEPT").as("d")
.filter(myFilter)
.project(
builder.field(1, "d", "DEPTNO"), // <-- exception if myFilter is literal(false)
builder.field(1, "d", "DNAME"))
.build();
{code}
> RelBuilder#empty does not keep aliases
> --------------------------------------
>
> Key: CALCITE-3172
> URL: https://issues.apache.org/jira/browse/CALCITE-3172
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Ruben Quesada Lopez
> Assignee: Ruben Quesada Lopez
> Priority: Minor
> Fix For: 1.21.0
>
>
> {{RelBuilder#empty}} method _"Creates a relational expression that reads from an input and throws all of the rows away... The default implementation creates a Values with the same specified row type as the input"_. However, even though the "original" rowType is kept, its aliases are lost, which can lead to issues when building a plan (especially because this method is used internally by other ones, e.g. by RelBuilder#filter with an "always false" filter).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)