[
https://issues.apache.org/jira/browse/CALCITE-2999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16817829#comment-16817829
]
Hongze Zhang commented on CALCITE-2999:
---------------------------------------
Thanks for your screenshot! I think maybe I understand your question now.
If I am not missing something, the field {{rowType}} describes exactly the
output of {{LogicalSort}}. In this case it emits 3 fields. But {{fieldExps}} is
not related to its output, it just holds a list of collation's input field
references.
The output type of the whole logical plan is located at {{RelRoot#fields}}. I
can't see the root node in the picture but it should have only 2 columns. If
that one shows 3 columns too, then it is a bug.
BTW, did you try executing the SQL on your data? Does any error occur?
> Can't get the right column value in LogicalSort
> -----------------------------------------------
>
> Key: CALCITE-2999
> URL: https://issues.apache.org/jira/browse/CALCITE-2999
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.19.0
> Reporter: yuqi
> Assignee: Danny Chan
> Priority: Critical
> Attachments: picture2.png, problem.png, problem.png
>
>
> Let's consider the sql:
> {code:sql}
> // Some comments here
> select 'hello', tag from b where text = '2' or text = '1' order by cast(text
> as int) + 1 asc , tag desc limit 1"
> {code}
> And the Plan can be seen in the picture below
> We can't get the right column value of LogicalSort if sort condition is not
> the select column list
> Can anyone help to explain this problem if i'm wrong
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)