|
4 | 4 | [](https://ci.appveyor.com/project/tanmaykm/parquet-jl-cufdj/branch/master)
|
5 | 5 | [](https://coveralls.io/github/JuliaIO/Parquet.jl?branch=master)
|
6 | 6 |
|
| 7 | +## Reader |
| 8 | + |
7 | 9 | Load a [parquet file](https://en.wikipedia.org/wiki/Apache_Parquet). Only metadata is read initially, data is loaded in chunks on demand. (Note: [ParquetFiles.jl](https://github.com/queryverse/ParquetFiles.jl) also provides load support for Parquet files under the FileIO.jl package.)
|
8 | 10 |
|
9 | 11 | `ParFile` represents a Parquet file at `path` open for reading. Options to map logical types can be provided via `map_logical_types`.
|
@@ -132,3 +134,31 @@ The reader will interpret logical types based on the `map_logical_types` provide
|
132 | 134 | - `logical_string(v): Applicable for strings that are `BYTE_ARRAY` values. Without this, they are represented in a `Vector{UInt8}` type. With this they are converted to `String` types.
|
133 | 135 |
|
134 | 136 | Variants of these methods or custom methods can also be applied by caller.
|
| 137 | + |
| 138 | +## Writer |
| 139 | + |
| 140 | +You can write any Tables.jl column-accessible table that contains columns of these types and their union with `Missing`: `Int32`, `Int64`, `String`, `Bool`, `Float32`, `Float64`. |
| 141 | + |
| 142 | +However, `CategoricalArray`s are not yet supported. Furthermore, these types are not yet supported: `Int96`, `Int128`, `Date`, and `DateTime`. |
| 143 | + |
| 144 | +### Writer Example |
| 145 | + |
| 146 | +```julia |
| 147 | +tbl = ( |
| 148 | + int32 = Int32.(1:1000), |
| 149 | + int64 = Int64.(1:1000), |
| 150 | + float32 = Float32.(1:1000), |
| 151 | + float64 = Float64.(1:1000), |
| 152 | + bool = rand(Bool, 1000), |
| 153 | + string = [randstring(8) for i in 1:1000], |
| 154 | + int32m = rand([missing, 1:100...], 1000), |
| 155 | + int64m = rand([missing, 1:100...], 1000), |
| 156 | + float32m = rand([missing, Float32.(1:100)...], 1000), |
| 157 | + float64m = rand([missing, Float64.(1:100)...], 1000), |
| 158 | + boolm = rand([missing, true, false], 1000), |
| 159 | + stringm = rand([missing, "abc", "def", "ghi"], 1000) |
| 160 | +) |
| 161 | + |
| 162 | +file = tempname()*".parquet" |
| 163 | +write_parquet(file, tbl) |
| 164 | +``` |
0 commit comments