Comments (3)
Hi @MrPowers,
I really like the idea of leveraging delta-like metadata handling for parquet files also.
Currently, Dask seems to collect footer information from every parquet file using Pyarrow (read_metadata) utilities and creates a global _metadata file.
So if we are tracking that information in a JSON file, What information we are planning to save in the JSON logs? and how we are going to collect that information?
I gave an initial read to this Delta protocol, Are we planning to save just the statistics, schema information
for every parquet file or some more things? and also how we are planning to make use of this information in dask readers perspective.
I am still confused here, so can you please shed some more light on this!
Thanks
from dask-deltatable.
@rajagurunath - the global _metadata file that Dask is currently creating is not scalable and I think we should ignore that file for purposes of this project. Assume write_metadata_file=False
.
Let's look at a little example and see what the outputted JSON file should look like:
df = pd.DataFrame(
{"letter": ["a", "b", "c", "a", "a", "d"], "number": [1, 2, 3, 4, 5, 6]}
)
ddf = dd.from_pandas(df, npartitions=3)
ddf.to_delta("tmp/parquet/1", engine="pyarrow", write_metadata_file=False)
Here's the JSON file that should be outputted:
{
"commitInfo":{
"timestamp":1632491414394,
"operation":"WRITE",
"operationParameters":{
"mode":"Overwrite",
"partitionBy":"[]"
},
"isBlindAppend":false,
"operationMetrics":{
"numFiles":"3",
"numOutputBytes":"2390",
"numOutputRows":"6"
}
}
}{
"protocol":{
"minReaderVersion":1,
"minWriterVersion":2
}
}{
"metaData":{
"id":"db102a08-5265-4f86-a281-dfc8cccacf0e",
"format":{
"provider":"parquet",
"options":{
}
},
"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"letter\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"number\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}}]}",
"partitionColumns":[
],
"configuration":{
},
"createdTime":1632491409910
}
}{
"add":{
"path":"part.0.parquet",
"partitionValues":{
},
"size":377,
"modificationTime":1632491410000,
"dataChange":true
}
}{
"add":{
"path":"part.1.parquet",
"partitionValues":{
},
"size":674,
"modificationTime":1632491410000,
"dataChange":true
}
}{
"add":{
"path":"part.2.parquet",
"partitionValues":{
},
"size":654,
"modificationTime":1632491410000,
"dataChange":true
}
}
Here's what the files should look like:
tmp/parquet/1/
_delta_log/
00000000000000000000.json
part.0.parquet
part.1.parquet
part.2.parquet
We basically need to create the _delta_log
exactly how Spark creates it when it writes Delta files. See this file for a code snippet on how to create Delta lakes with Spark.
Let me know if you have any additional questions. You're doing great work and I'm happy to help!
from dask-deltatable.
from dask-deltatable.
Related Issues (20)
- Avoid using delayed when making dask dataframe HOT 1
- Package on conda-forge HOT 6
- Implement writing with categoricals
- Support `partition_freq` when writing
- Support writing and reading back index
- Implement `mode == "overwrite"` in `to_deltalake`
- Handle timestamps other than `datetime64[us]`
- Release soon? HOT 5
- Finalize API for writing Delta Tables HOT 1
- Support pyarrow types_mapper kwarg
- Pickle error with `ParquetFileWriteOptions` and `distributed.Client`
- Support reading and writing to remote filesystems (s3, gcsfs, azure)
- Credentials for remote filesystems?
- `storage_options` inconsistency between `read_deltalake` and `to_deltalake`
- `TypeError`: cannot pickle `builtins.RawDeltaTable` object
- `read_deltalake` vs `read_parquet` performance HOT 1
- Can we get rid of `filters_to_expression`?
- What are the limitations of to_deltalake? HOT 1
- Problem with `pyarrow` dependency when installing dask-deltatable HOT 3
- Failed import when running `deltalake==0.14.0` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask-deltatable.