[ 
https://issues.apache.org/jira/browse/CALCITE-6925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941706#comment-17941706
 ] 

Julian Hyde commented on CALCITE-6925:
--------------------------------------

Does this change make sense? I am genuinely torn.  At the root is the question: 
what is a 'logical' operator?

I think it's just an operator that doesn't belong to a particular calling 
convention. It doesn't mean that it doesn't have some physical properties.

A table (a data set at the leaf of a query plan) might have physical properties 
such as whether it is sorted, or whether it is partitioned. Those physical 
properties can be inherited by any calling-convention or physical operator that 
supports them, and ignored by any calling-convention or physical operator that 
does not.

Tables are not relational operators, but they are intimately connected to them. 
If a references EMP and DEPT tables, any valid implementation of that query, in 
any calling-convention, must reference those tables. So, arguments that apply 
to tables should apply to logical operators. And it certainly makes sense for 
tables to have physical properties.

I made the decision a long time ago that a logical operator has infinite cost. 
That is a decision I have regretted, because you want to be able to apply 
logical rewrite rules (such as pushing down filters) and ask whether they are 
beneficial. The infinite cost was a convenient marker to say 'we haven't found 
a concrete plan for this node yet' but it was inconvenient in other ways.

I'm not sure what motivated you to log this bug. It might have been 
philosophical consistency, but I imagine that you ran into an actual bug and 
removing traits was a convenient way to solve it. Since you haven't convinced 
me (either way) that your philosophy is clearly the right one, maybe we should 
talk about the problem that motivated this case.

> Logical operator should remove RelDistributionTraitDef
> ------------------------------------------------------
>
>                 Key: CALCITE-6925
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6925
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Zhen Chen
>            Assignee: Zhen Chen
>            Priority: Major
>              Labels: pull-request-available
>
> Some logical operator (such as LogicalFilter) contains distribution trait, 
> this trait is a physical trait. we maybe can remove it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to