Source File
doc.go
Belonging Package
github.com/apache/arrow-go/v18/parquet
// Licensed to the Apache Software Foundation (ASF) under one// or more contributor license agreements. See the NOTICE file// distributed with this work for additional information// regarding copyright ownership. The ASF licenses this file// to you under the Apache License, Version 2.0 (the// "License"); you may not use this file except in compliance// with the License. You may obtain a copy of the License at//// http://www.apache.org/licenses/LICENSE-2.0//// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.// Package parquet provides an implementation of Apache Parquet for Go.//// Apache Parquet is an open-source columnar data storage format using the record// shredding and assembly algorithm to accommodate complex data structures which// can then be used to efficiently store the data.//// This implementation is a native go implementation for reading and writing the// parquet file format.//// # Install//// You can download the library and cli utilities via://// go get -u github.com/apache/arrow-go/v18/parquet// go install github.com/apache/arrow-go/v18/parquet/cmd/parquet_reader@latest// go install github.com/apache/arrow-go/v18/parquet/cmd/parquet_schema@latest//// # Modules//// This top level parquet package contains the basic common types and reader/writer// properties along with some utilities that are used throughout the other modules.//// The file module contains the functions for directly reading/writing parquet files// including Column Readers and Column Writers.//// The metadata module contains the types for managing the lower level file/rowgroup/column// metadata inside of a ParquetFile including inspecting the statistics.//// The pqarrow module contains helper functions and types for converting directly// between Parquet and Apache Arrow formats.//// The schema module contains the types for manipulating / inspecting / creating// parquet file schemas.//// # Primitive Types//// The Parquet Primitive Types and their corresponding Go types are Boolean (bool),// Int32 (int32), Int64 (int64), Int96 (parquet.Int96), Float (float32), Double (float64),// ByteArray (parquet.ByteArray) and FixedLenByteArray (parquet.FixedLenByteArray).//// # Encodings//// The encoding types supported in this package are://// - Plain//// - Plain/RLE Dictionary//// - Delta Binary Packed (only integer types)//// - Delta Byte Array (only ByteArray)//// - Delta Length Byte Array (only ByteArray)//// - Byte Stream Split (Float, Double, Int32, Int64, FixedLenByteArray)//// - ALP, Adaptive Lossless floating-Point (Float, Double). The Parquet// format marks ALP as a preview encoding, so writing it is opt-in: enable// it with WithALPEncoding, select it per column with WithEncodingFor or// WithEncodingPath, and turn off dictionary encoding for those columns.// Reading needs no option.//// Tip: Some platforms don't necessarily support all kinds of encodings. If you're not// sure what to use, just use Plain and Dictionary encoding.//// # Arrow to Parquet Type Mappings//// When reading and writing Parquet, the parquet package converts between Arrow// and Parquet types in the manner described in the table below.//// When converting a Parquet type where a large and non-large offset Arrow type// would work, the non-large variant is chosen. If the Parquet file is written// with `WithStoreSchema`, types will be preserved and dictionaries will be// restored when round-tripping.//// Arrow Type Parquet Physical Type Parquet Logical Type// ---------- --------------------- --------------------// NULL Int32 Null// BOOL Boolean -// INT8 Int32 Int(8, signed)// UINT8 Int32 Int(8, unsigned)// INT16 Int32 Int(16, signed)// UINT16 Int32 Int(16, unsigned)// INT32 Int32 Int(32, signed)// UINT32 Int32 Int(32, unsigned)// INT64 Int64 Int(64, signed)// UINT64 Int64 Int(64, unsigned)// FLOAT16 FixedLenByteArray(2) Float16// FLOAT32 Float -// FLOAT64 Double -// STRING ByteArray String// LARGE_STRING ByteArray String// BINARY ByteArray -// LARGE_BINARY ByteArray -// FIXED_SIZE_BINARY FixedLenByteArray -// DECIMAL128 Int32/Int64/FLBA* Decimal// DECIMAL256 Int32/Int64/FLBA* Decimal// DATE32 Int32 Date// DATE64 Int32 Date// TIMESTAMP Int64 or Int96 Timestamp// TIME32 Int32 Time(millis)// TIME64 Int64 Time(micros/nanos)// LIST Group (LIST) -// FIXED_SIZE_LIST Group (LIST) -// STRUCT Group -// MAP Group (MAP) -// DICTIONARY (converted to value type) -// EXTENSION (depends on storage) (may be custom)//// * FLBA means FixedLenByteArray//// Unsupported Arrow Types (will return arrow.ErrNotImplemented)://// DURATION, INTERVAL_MONTHS, INTERVAL_DAY_TIME, INTERVAL_MONTH_DAY_NANO// SPARSE_UNION, DENSE_UNION// STRING_VIEW, BINARY_VIEW, LIST_VIEW, LARGE_LIST_VIEW// LARGE_LIST, RUN_END_ENCODED// DECIMAL32, DECIMAL64package parquet//go:generate go tool stringer -type=Version -linecomment//go:generate thrift -o internal -r --gen go ../parquet.thrift
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |