parquetio

package
v2.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 2

Documentation

Overview

Package parquetio contains transforms for reading and writing parquet files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(s beam.Scope, glob string, t reflect.Type) beam.PCollection

Read reads a set of files and returns lines as a PCollection<elem> based on type of a parquetStruct (struct with parquet tags). For example:

type Student struct {
  Name    string  `parquet:"name=name, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
  Age     int32   `parquet:"name=age, type=INT32, encoding=PLAIN"`
  Id      int64   `parquet:"name=id, type=INT64"`
  Weight  float32 `parquet:"name=weight, type=FLOAT"`
  Sex     bool    `parquet:"name=sex, type=BOOLEAN"`
  Day     int32   `parquet:"name=day, type=INT32, convertedtype=DATE"`
  Ignored int32   //without parquet tag and won't write
}

func Write

func Write(s beam.Scope, filename string, t reflect.Type, col beam.PCollection)

Write writes a PCollection<parquetStruct> to .parquet file. Write expects a type t of struct with parquet tags For example:

type Student struct {
  Name    string  `parquet:"name=name, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"`
  Age     int32   `parquet:"name=age, type=INT32, encoding=PLAIN"`
  Id      int64   `parquet:"name=id, type=INT64"`
  Weight  float32 `parquet:"name=weight, type=FLOAT"`
  Sex     bool    `parquet:"name=sex, type=BOOLEAN"`
  Day     int32   `parquet:"name=day, type=INT32, convertedtype=DATE"`
  Ignored int32   //without parquet tag and won't write
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL