-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor: update ScanCallback to use ScanFile struct #576
base: main
Are you sure you want to change the base?
Changes from 4 commits
c9dcaf3
dd4a095
bc917d7
a9a8960
06fa197
5a2e085
2b1e112
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 |
---|---|---|
|
@@ -81,6 +81,7 @@ fn main() -> ExitCode { | |
struct ScanFile { | ||
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. We don't need the Same comment for all the other custom 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. Yeah makes sense, looks pretty clean now imo |
||
path: String, | ||
size: i64, | ||
stats: Option<Stats>, | ||
partition_values: HashMap<String, String>, | ||
dv_info: DvInfo, | ||
} | ||
|
@@ -105,19 +106,13 @@ fn truncate_batch(batch: RecordBatch, rows: usize) -> RecordBatch { | |
} | ||
|
||
// This is the callback that will be called fo each valid scan row | ||
fn send_scan_file( | ||
scan_tx: &mut spmc::Sender<ScanFile>, | ||
path: &str, | ||
size: i64, | ||
_stats: Option<Stats>, | ||
dv_info: DvInfo, | ||
partition_values: HashMap<String, String>, | ||
) { | ||
fn send_scan_file(scan_tx: &mut spmc::Sender<ScanFile>, file: delta_kernel::scan::state::ScanFile) { | ||
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. Likewise here, no need to unwrap and then re-wrap the struct, just use the kernel one |
||
let scan_file = ScanFile { | ||
path: path.to_string(), | ||
size, | ||
partition_values, | ||
dv_info, | ||
path: file.path.to_string(), | ||
size: file.size, | ||
stats: file.stats, | ||
partition_values: file.partition_values, | ||
dv_info: file.dv_info, | ||
}; | ||
scan_tx.send(scan_file).unwrap(); | ||
} | ||
|
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.
This doesn't work at all. See test failures.
In particular:
ScanFile
String
, so you need something like: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.
Yeah makes sense, fixed. Is there to run these tests locally? I took a look at the GH action but seems like a non-trivial amount of setup.
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 you should be able to just run
cargo test
in the ffi crate locallyThere 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'm also not seeing a fix? I think you might need to push