mustafasrepo commented on code in PR #9127: URL: https://github.com/apache/arrow-datafusion/pull/9127#discussion_r1494483241
########## datafusion/sqllogictest/test_files/monotonic_projection_test.slt: ########## @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# prepare the table +statement ok +CREATE EXTERNAL TABLE delta_encoding_required_column ( + c_customer_sk INT NOT NULL, + c_current_cdemo_sk INT NOT NULL +) +STORED AS CSV +WITH ORDER ( + c_customer_sk DESC, + c_current_cdemo_sk DESC +) +LOCATION '../../testing/data/csv/aggregate_test_100.csv'; + +# test for substitute CAST senario +query TT +EXPLAIN +SELECT + CAST(c_customer_sk AS BIGINT) AS c_customer_sk_big, + c_current_cdemo_sk Review Comment: If the select expressions were `c_customer_sk, CAST(c_customer_sk AS BIGINT) AS c_customer_sk_big, c_current_cdemo_sk` planner wouldn't remove the `ORDER BY c_customer_sk_big DESC, c_current_cdemo_sk DESC` sort from the plan. However, it should be possible. Because, in current implementation, substitution cannot generate more than 1 valid ordering from a single ordering. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
