Skip to content

Commit d514acb

Browse files
committed
fix assertion: it seems that this depended on some sort behavior that changed between releases. the test has been extended to select a multiple of the partitions such that we can assert on ids 0,1,2,3 entirely.
the output of the failure BEFORE this change is below -- i think that the new "actual" output is more correct as it starts in order of the month/day buckets. anyway, for purposes of testing the metadata columns, this works, and this is why this change was made expected: 11:33:22 [15/4643] [ "+----+------+----------------------------------------+----------------------+", "| id | size | location | last_modified |", "+----+------+----------------------------------------+----------------------+", "| 0 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 0 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 0 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 3 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "+----+------+----------------------------------------+----------------------+", ] actual: [ "+----+------+----------------------------------------+----------------------+", "| id | size | location | last_modified |", "+----+------+----------------------------------------+----------------------+", "| 0 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 0 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 0 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 1 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |", "| 2 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |", "| 3 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |", "+----+------+----------------------------------------+----------------------+", ]
1 parent 604463b commit d514acb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

datafusion/core/tests/sql/path_partition.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ async fn test_metadata_columns() -> Result<()> {
598598
ctx.register_table("t", table).unwrap();
599599

600600
let result = ctx
601-
.sql("SELECT id, size, location, last_modified FROM t WHERE size > 1500 ORDER BY id LIMIT 10")
601+
.sql("SELECT id, size, location, last_modified FROM t WHERE size > 1500 ORDER BY id LIMIT 12")
602602
.await?
603603
.collect()
604604
.await?;
@@ -616,9 +616,12 @@ async fn test_metadata_columns() -> Result<()> {
616616
"| 2 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |",
617617
"| 2 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |",
618618
"| 2 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |",
619+
"| 3 | 1851 | year=2021/month=09/day=09/file.parquet | 1970-01-01T00:00:00Z |",
620+
"| 3 | 1851 | year=2021/month=10/day=09/file.parquet | 1970-01-01T00:00:00Z |",
619621
"| 3 | 1851 | year=2021/month=10/day=28/file.parquet | 1970-01-01T00:00:00Z |",
620622
"+----+------+----------------------------------------+----------------------+",
621623
];
624+
622625
assert_batches_sorted_eq!(expected, &result);
623626

624627
Ok(())

0 commit comments

Comments
 (0)