Skip to content

Commit

Permalink
add test case for table with null stats in notnull struct
Browse files Browse the repository at this point in the history
  • Loading branch information
qinix authored and rtyler committed Mar 28, 2024
1 parent e2aa8ba commit 01f832c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/core/tests/read_delta_log_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,13 @@ async fn read_delta_table_from_dlt() {
assert_eq!(table.version(), 1);
assert!(table.get_schema().is_ok());
}

#[tokio::test]
async fn read_delta_table_with_null_stats_in_notnull_struct() {
let table =
deltalake_core::open_table("../test/tests/data/table_with_null_stats_in_notnull_struct")
.await
.unwrap();
assert_eq!(table.version(), 1);
assert!(table.get_schema().is_ok());
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"commitInfo":{"timestamp":1711560767220,"operation":"CREATE OR REPLACE TABLE","operationParameters":{"isManaged":"false","description":null,"partitionBy":"[]","properties":"{}"},"isolationLevel":"Serializable","isBlindAppend":true,"operationMetrics":{},"engineInfo":"Apache-Spark/3.5.1 Delta-Lake/3.1.0","txnId":"99840af5-4b41-4a0e-b1b8-8d22ae77ccf6"}}
{"metaData":{"id":"e849a43f-42e1-404e-b13d-224d85eb7573","format":{"provider":"parquet","options":{}},"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"s\",\"type\":{\"type\":\"struct\",\"fields\":[{\"name\":\"l\",\"type\":\"long\",\"nullable\":false,\"metadata\":{}},{\"name\":\"b\",\"type\":\"boolean\",\"nullable\":false,\"metadata\":{}}]},\"nullable\":false,\"metadata\":{}}]}","partitionColumns":[],"configuration":{},"createdTime":1711560767211}}
{"protocol":{"minReaderVersion":1,"minWriterVersion":2}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"commitInfo":{"timestamp":1711560789508,"operation":"WRITE","operationParameters":{"mode":"Append","partitionBy":"[]"},"readVersion":0,"isolationLevel":"Serializable","isBlindAppend":true,"operationMetrics":{"numFiles":"3","numOutputRows":"2","numOutputBytes":"1978"},"engineInfo":"Apache-Spark/3.5.1 Delta-Lake/3.1.0","txnId":"80eed5be-d309-42dd-91e9-e1215a03e6dd"}}
{"add":{"path":"part-00004-e7a7f9d9-18cb-45ee-9d64-6c711cd8eb77-c000.snappy.parquet","partitionValues":{},"size":763,"modificationTime":1711560789496,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"s\":{\"l\":10}},\"maxValues\":{\"s\":{\"l\":10}},\"nullCount\":{\"s\":{\"l\":0,\"b\":0}}}"}}
{"add":{"path":"part-00009-ffa42641-8c4e-4f27-875e-bbb68e3bb100-c000.snappy.parquet","partitionValues":{},"size":762,"modificationTime":1711560789496,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"s\":{\"l\":20}},\"maxValues\":{\"s\":{\"l\":20}},\"nullCount\":{\"s\":{\"l\":0,\"b\":0}}}"}}
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 01f832c

Please sign in to comment.