comphead commented on code in PR #10381:
URL: https://github.com/apache/datafusion/pull/10381#discussion_r1595586048


##########
datafusion/sqllogictest/test_files/parquet_sorted_statistics.slt:
##########
@@ -260,3 +260,77 @@ physical_plan
 01)SortPreservingMergeExec: [constant_col@0 ASC NULLS LAST]
 02)--SortExec: expr=[constant_col@0 ASC NULLS LAST], 
preserve_partitioning=[true]
 03)----ParquetExec: file_groups={2 groups: 
[[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/parquet_sorted_statistics/test_table/partition_col=A/0.parquet,
 
WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/parquet_sorted_statistics/test_table/partition_col=B/1.parquet],
 
[WORKSPACE_ROOT/datafusion/sqllogictest/test_files/scratch/parquet_sorted_statistics/test_table/partition_col=C/2.parquet]]},
 projection=[constant_col]
+
+statement ok
+DROP TABLE test_table;
+
+# Create a table as a data source
+statement ok
+CREATE TABLE src_table2 (
+  a INT,
+  b INT,
+  c INT
+) AS VALUES
+-- first file
+(1, 100, 0),
+(2, 200, 0),
+(3, 300, 0),
+-- second file
+(7, 700, 0),
+(8, 800, 0),
+(9, 900, 0);
+
+# Create files: file1.parquet, file2.parquet both sorted on a
+# but file 1 has the columns in the order a, b, c and file 2 has the columns 
in the order c, b, a
+# The keyranges of values of a should be non overlapping
+
+# Create file1.parquet
+query III
+COPY (SELECT * FROM src_table2 WHERE a <= 3 ORDER BY a)
+TO 'test_files/scratch/parquet_sorted_statistics/test_table1/0.parquet'
+STORED AS PARQUET;
+----
+3
+
+# Create file2.parquet
+query III
+COPY (SELECT c, b, a FROM src_table2 WHERE a > 6 ORDER BY a)
+TO 'test_files/scratch/parquet_sorted_statistics/test_table1/1.parquet'
+STORED AS PARQUET;
+----
+3
+
+# Create an external table a, b, c with explicit order by a
+statement ok
+CREATE EXTERNAL TABLE test_table (
+  partition_col TEXT NOT NULL,
+  a INT NOT NULL,
+  b INT NOT NULL,
+  c INT NOT NULL
+)
+STORED AS PARQUET
+PARTITIONED BY (partition_col)
+WITH ORDER (a ASC NULLS LAST)
+LOCATION 'test_files/scratch/parquet_sorted_statistics/test_table1';
+
+query TT

Review Comment:
   thanks @yyy1000 would you mind adding the description what exactly it tests, 
what is so outstanding in the output we looking for? 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to