yyy1000 commented on PR #10463: URL: https://github.com/apache/datafusion/pull/10463#issuecomment-2106065020
The example in #10456 in this PR like below ``` > create table t (c int) as values (1), (3), (5); 0 row(s) fetched. Elapsed 0.031 seconds. > explain verbose select struct(c) from t where c between 3 and 1; +------------------------------------------------------------+--------------------------------------------------------------------+ | plan_type | plan | +------------------------------------------------------------+--------------------------------------------------------------------+ | initial_logical_plan | Projection: struct(t.c) | | | Filter: t.c BETWEEN Int64(3) AND Int64(1) | | | TableScan: t | | logical_plan after apply_function_rewrites | SAME TEXT AS ABOVE | | logical_plan after inline_table_scan | SAME TEXT AS ABOVE | | logical_plan after type_coercion | Projection: struct(t.c) | | | Filter: CAST(t.c AS Int64) BETWEEN Int64(3) AND Int64(1) | | | TableScan: t | | logical_plan after count_wildcard_rule | SAME TEXT AS ABOVE | | analyzed_logical_plan | SAME TEXT AS ABOVE | | logical_plan after eliminate_nested_union | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | Projection: struct(t.c) | | | Filter: Boolean(false) | | | TableScan: t | | logical_plan after unwrap_cast_in_comparison | SAME TEXT AS ABOVE | | logical_plan after replace_distinct_aggregate | SAME TEXT AS ABOVE | | logical_plan after eliminate_join | SAME TEXT AS ABOVE | | logical_plan after decorrelate_predicate_subquery | SAME TEXT AS ABOVE | | logical_plan after scalar_subquery_to_join | SAME TEXT AS ABOVE | | logical_plan after extract_equijoin_predicate | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | SAME TEXT AS ABOVE | | logical_plan after rewrite_disjunctive_predicate | SAME TEXT AS ABOVE | | logical_plan after eliminate_duplicated_expr | SAME TEXT AS ABOVE | | logical_plan after eliminate_filter | Projection: struct(t.c) | | | EmptyRelation | | logical_plan after eliminate_cross_join | SAME TEXT AS ABOVE | | logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE | | logical_plan after eliminate_limit | SAME TEXT AS ABOVE | | logical_plan after propagate_empty_relation | EmptyRelation | | logical_plan after eliminate_one_union | SAME TEXT AS ABOVE | | logical_plan after filter_null_join_keys | SAME TEXT AS ABOVE | | logical_plan after eliminate_outer_join | SAME TEXT AS ABOVE | | logical_plan after push_down_limit | SAME TEXT AS ABOVE | | logical_plan after push_down_filter | SAME TEXT AS ABOVE | | logical_plan after single_distinct_aggregation_to_group_by | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | SAME TEXT AS ABOVE | | logical_plan after unwrap_cast_in_comparison | SAME TEXT AS ABOVE | | logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE | | logical_plan after optimize_projections | SAME TEXT AS ABOVE | | logical_plan after eliminate_nested_union | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | SAME TEXT AS ABOVE | | logical_plan after unwrap_cast_in_comparison | SAME TEXT AS ABOVE | | logical_plan after replace_distinct_aggregate | SAME TEXT AS ABOVE | | logical_plan after eliminate_join | SAME TEXT AS ABOVE | | logical_plan after decorrelate_predicate_subquery | SAME TEXT AS ABOVE | | logical_plan after scalar_subquery_to_join | SAME TEXT AS ABOVE | | logical_plan after extract_equijoin_predicate | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | SAME TEXT AS ABOVE | | logical_plan after rewrite_disjunctive_predicate | SAME TEXT AS ABOVE | | logical_plan after eliminate_duplicated_expr | SAME TEXT AS ABOVE | | logical_plan after eliminate_filter | SAME TEXT AS ABOVE | | logical_plan after eliminate_cross_join | SAME TEXT AS ABOVE | | logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE | | logical_plan after eliminate_limit | SAME TEXT AS ABOVE | | logical_plan after propagate_empty_relation | SAME TEXT AS ABOVE | | logical_plan after eliminate_one_union | SAME TEXT AS ABOVE | | logical_plan after filter_null_join_keys | SAME TEXT AS ABOVE | | logical_plan after eliminate_outer_join | SAME TEXT AS ABOVE | | logical_plan after push_down_limit | SAME TEXT AS ABOVE | | logical_plan after push_down_filter | SAME TEXT AS ABOVE | | logical_plan after single_distinct_aggregation_to_group_by | SAME TEXT AS ABOVE | | logical_plan after simplify_expressions | SAME TEXT AS ABOVE | | logical_plan after unwrap_cast_in_comparison | SAME TEXT AS ABOVE | | logical_plan after common_sub_expression_eliminate | SAME TEXT AS ABOVE | | logical_plan after optimize_projections | SAME TEXT AS ABOVE | | logical_plan | EmptyRelation | | initial_physical_plan | EmptyExec | | | | | initial_physical_plan_with_stats | EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), [(Col[0]:)]] | | | | | physical_plan after OutputRequirements | OutputRequirementExec | | | EmptyExec | | | | | physical_plan after aggregate_statistics | SAME TEXT AS ABOVE | | physical_plan after join_selection | SAME TEXT AS ABOVE | | physical_plan after LimitedDistinctAggregation | SAME TEXT AS ABOVE | | physical_plan after EnforceDistribution | SAME TEXT AS ABOVE | | physical_plan after CombinePartialFinalAggregate | SAME TEXT AS ABOVE | | physical_plan after EnforceSorting | SAME TEXT AS ABOVE | | physical_plan after OptimizeAggregateOrder | SAME TEXT AS ABOVE | | physical_plan after ProjectionPushdown | SAME TEXT AS ABOVE | | physical_plan after coalesce_batches | SAME TEXT AS ABOVE | | physical_plan after OutputRequirements | EmptyExec | | | | | physical_plan after PipelineChecker | SAME TEXT AS ABOVE | | physical_plan after LimitAggregation | SAME TEXT AS ABOVE | | physical_plan after ProjectionPushdown | SAME TEXT AS ABOVE | | physical_plan | EmptyExec | | | | | physical_plan_with_stats | EmptyExec, statistics=[Rows=Exact(0), Bytes=Exact(0), [(Col[0]:)]] | | | | +------------------------------------------------------------+--------------------------------------------------------------------+ 77 row(s) fetched. Elapsed 0.012 seconds. ``` However, I was thinking whether it's good to simplify like this or we just throw an error if low > high? I'm not quiet clear under what circumstance will the low > high except error situation. 🤔 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org