-
Notifications
You must be signed in to change notification settings - Fork 474
fix: ignore temp log entries #3423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
32e2f84
8312eb9
3f54328
7d4efb6
c319ae4
861c19f
e6b85e3
84b44e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ use std::time::SystemTime; | |
|
||
#[tokio::test] | ||
async fn time_travel_by_ds() { | ||
// test time travel on a table with an uncommited delta in a .tmp subfolder | ||
|
||
// git does not preserve mtime, so we need to manually set it in the test | ||
let log_dir = "../test/tests/data/simple_table/_delta_log"; | ||
let log_mtime_pair = vec![ | ||
|
@@ -13,6 +15,11 @@ async fn time_travel_by_ds() { | |
("00000000000000000002.json", "2020-05-03T22:47:31-07:00"), | ||
("00000000000000000003.json", "2020-05-04T22:47:31-07:00"), | ||
("00000000000000000004.json", "2020-05-05T22:47:31-07:00"), | ||
// Final file is uncommitted by Spark and is in a .tmp subdir | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this fix ignores any sub-directory, the test should also contain a testcase of a sub-directory not starting with a dot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why we need a second test case? The name of the subdirectory does not matter, any and all files in subdirectories are ignored. I only used the name |
||
( | ||
".tmp/00000000000000000005.json", | ||
"2020-05-06T22:47:31-07:00", | ||
), | ||
]; | ||
for (fname, ds) in log_mtime_pair { | ||
let ts: SystemTime = ds_to_ts(ds).into(); | ||
|
@@ -79,6 +86,7 @@ async fn time_travel_by_ds() { | |
.unwrap(); | ||
assert_eq!(table.version(), 4); | ||
|
||
// Final append in .tmp subdir is uncommited and should be ignored | ||
table = deltalake_core::open_table_with_ds( | ||
"../test/tests/data/simple_table", | ||
"2020-05-25T22:47:31-07:00", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"commitInfo":{"timestamp":1587968626637,"operation":"WRITE","operationParameters":{"mode":"Overwrite","partitionBy":"[]"},"readVersion":4,"isBlindAppend":true}} | ||
{"add":{"path":"part-00000-c1777d7d-89d9-4790-b38a-6ee7e24456b1-c001.snappy.parquet","partitionValues":{},"size":262,"modificationTime":1587968626600,"dataChange":true}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the pending operation in the .tmp subfolder + parquet file below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function, plus the one below may need to be fixed as well to ignore temp subdirectories but I could use some feedback here + pointers to the associated unit test.