https://delta.io logo
k

Kenny Ma

02/16/2023, 12:03 AM
Using the Delta standalone library is there a way to get the transactions of a single and range of versions? I have a parquet file that I would like to find the Delta version that the file was added without scanning all the versions.
Yup! Just use the
Iterator<VersionLog> getChanges(long startVersion, boolean failOnDataLoss);
API
for a single version - just exit after the head of the iterator
for a range of versions - just exit after the
versionLog.getVersion
is outside of your range
not quite sure what your use case is, production code or debugging, but you could also look at the raw
_delta_log
json files, too
and just use grep
k

Kenny Ma

02/16/2023, 12:30 AM
Thanks @Scott Sandre (Delta Lake). I didn’t want to parse the
__delta__log
json files if the library provides an API to get the info. I will take a look at your example above.
4 Views