{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}

module DataFrame.IO.Parquet.Thrift where

import Data.ByteString (ByteString)
import Data.Int (Int16, Int32, Int64, Int8)
import Data.Text (Text)
import GHC.Generics (Generic)
import GHC.TypeLits (KnownNat)
import Pinch (Enumeration, Field, Pinchable (..))
import qualified Pinch

-- Primitive Parquet Types
-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L32
data ThriftType
    = BOOLEAN (Enumeration 0)
    | INT32 (Enumeration 1)
    | INT64 (Enumeration 2)
    | INT96 (Enumeration 3)
    | FLOAT (Enumeration 4)
    | DOUBLE (Enumeration 5)
    | BYTE_ARRAY (Enumeration 6)
    | FIXED_LEN_BYTE_ARRAY (Enumeration 7)
    deriving (ThriftType -> ThriftType -> Bool
(ThriftType -> ThriftType -> Bool)
-> (ThriftType -> ThriftType -> Bool) -> Eq ThriftType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThriftType -> ThriftType -> Bool
== :: ThriftType -> ThriftType -> Bool
$c/= :: ThriftType -> ThriftType -> Bool
/= :: ThriftType -> ThriftType -> Bool
Eq, Int -> ThriftType -> ShowS
[ThriftType] -> ShowS
ThriftType -> String
(Int -> ThriftType -> ShowS)
-> (ThriftType -> String)
-> ([ThriftType] -> ShowS)
-> Show ThriftType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThriftType -> ShowS
showsPrec :: Int -> ThriftType -> ShowS
$cshow :: ThriftType -> String
show :: ThriftType -> String
$cshowList :: [ThriftType] -> ShowS
showList :: [ThriftType] -> ShowS
Show, (forall x. ThriftType -> Rep ThriftType x)
-> (forall x. Rep ThriftType x -> ThriftType) -> Generic ThriftType
forall x. Rep ThriftType x -> ThriftType
forall x. ThriftType -> Rep ThriftType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ThriftType -> Rep ThriftType x
from :: forall x. ThriftType -> Rep ThriftType x
$cto :: forall x. Rep ThriftType x -> ThriftType
to :: forall x. Rep ThriftType x -> ThriftType
Generic)

instance Pinchable ThriftType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L183
data FieldRepetitionType
    = REQUIRED (Enumeration 0)
    | OPTIONAL (Enumeration 1)
    | REPEATED (Enumeration 2)
    deriving (FieldRepetitionType -> FieldRepetitionType -> Bool
(FieldRepetitionType -> FieldRepetitionType -> Bool)
-> (FieldRepetitionType -> FieldRepetitionType -> Bool)
-> Eq FieldRepetitionType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FieldRepetitionType -> FieldRepetitionType -> Bool
== :: FieldRepetitionType -> FieldRepetitionType -> Bool
$c/= :: FieldRepetitionType -> FieldRepetitionType -> Bool
/= :: FieldRepetitionType -> FieldRepetitionType -> Bool
Eq, Int -> FieldRepetitionType -> ShowS
[FieldRepetitionType] -> ShowS
FieldRepetitionType -> String
(Int -> FieldRepetitionType -> ShowS)
-> (FieldRepetitionType -> String)
-> ([FieldRepetitionType] -> ShowS)
-> Show FieldRepetitionType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FieldRepetitionType -> ShowS
showsPrec :: Int -> FieldRepetitionType -> ShowS
$cshow :: FieldRepetitionType -> String
show :: FieldRepetitionType -> String
$cshowList :: [FieldRepetitionType] -> ShowS
showList :: [FieldRepetitionType] -> ShowS
Show, (forall x. FieldRepetitionType -> Rep FieldRepetitionType x)
-> (forall x. Rep FieldRepetitionType x -> FieldRepetitionType)
-> Generic FieldRepetitionType
forall x. Rep FieldRepetitionType x -> FieldRepetitionType
forall x. FieldRepetitionType -> Rep FieldRepetitionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FieldRepetitionType -> Rep FieldRepetitionType x
from :: forall x. FieldRepetitionType -> Rep FieldRepetitionType x
$cto :: forall x. Rep FieldRepetitionType x -> FieldRepetitionType
to :: forall x. Rep FieldRepetitionType x -> FieldRepetitionType
Generic)

instance Pinchable FieldRepetitionType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L203
data Encoding
    = PLAIN (Enumeration 0)
    | -- GROUP_VAR_INT Encoding was never used
      -- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L578
      PLAIN_DICTIONARY (Enumeration 2)
    | RLE (Enumeration 3)
    | BIT_PACKED (Enumeration 4)
    | DELTA_BINARY_PACKED (Enumeration 5)
    | DELTA_LENGTH_BYTE_ARRAY (Enumeration 6)
    | DELTA_BYTE_ARRAY (Enumeration 7)
    | RLE_DICTIONARY (Enumeration 8)
    | BYTE_STREAM_SPLIT (Enumeration 9)
    deriving (Encoding -> Encoding -> Bool
(Encoding -> Encoding -> Bool)
-> (Encoding -> Encoding -> Bool) -> Eq Encoding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Encoding -> Encoding -> Bool
== :: Encoding -> Encoding -> Bool
$c/= :: Encoding -> Encoding -> Bool
/= :: Encoding -> Encoding -> Bool
Eq, Int -> Encoding -> ShowS
[Encoding] -> ShowS
Encoding -> String
(Int -> Encoding -> ShowS)
-> (Encoding -> String) -> ([Encoding] -> ShowS) -> Show Encoding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Encoding -> ShowS
showsPrec :: Int -> Encoding -> ShowS
$cshow :: Encoding -> String
show :: Encoding -> String
$cshowList :: [Encoding] -> ShowS
showList :: [Encoding] -> ShowS
Show, (forall x. Encoding -> Rep Encoding x)
-> (forall x. Rep Encoding x -> Encoding) -> Generic Encoding
forall x. Rep Encoding x -> Encoding
forall x. Encoding -> Rep Encoding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Encoding -> Rep Encoding x
from :: forall x. Encoding -> Rep Encoding x
$cto :: forall x. Rep Encoding x -> Encoding
to :: forall x. Rep Encoding x -> Encoding
Generic)

instance Pinchable Encoding

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L244
data CompressionCodec
    = UNCOMPRESSED (Enumeration 0)
    | SNAPPY (Enumeration 1)
    | GZIP (Enumeration 2)
    | LZO (Enumeration 3)
    | BROTLI (Enumeration 4)
    | LZ4 (Enumeration 5)
    | ZSTD (Enumeration 6)
    | LZ4_RAW (Enumeration 7)
    deriving (CompressionCodec -> CompressionCodec -> Bool
(CompressionCodec -> CompressionCodec -> Bool)
-> (CompressionCodec -> CompressionCodec -> Bool)
-> Eq CompressionCodec
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CompressionCodec -> CompressionCodec -> Bool
== :: CompressionCodec -> CompressionCodec -> Bool
$c/= :: CompressionCodec -> CompressionCodec -> Bool
/= :: CompressionCodec -> CompressionCodec -> Bool
Eq, Int -> CompressionCodec -> ShowS
[CompressionCodec] -> ShowS
CompressionCodec -> String
(Int -> CompressionCodec -> ShowS)
-> (CompressionCodec -> String)
-> ([CompressionCodec] -> ShowS)
-> Show CompressionCodec
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CompressionCodec -> ShowS
showsPrec :: Int -> CompressionCodec -> ShowS
$cshow :: CompressionCodec -> String
show :: CompressionCodec -> String
$cshowList :: [CompressionCodec] -> ShowS
showList :: [CompressionCodec] -> ShowS
Show, (forall x. CompressionCodec -> Rep CompressionCodec x)
-> (forall x. Rep CompressionCodec x -> CompressionCodec)
-> Generic CompressionCodec
forall x. Rep CompressionCodec x -> CompressionCodec
forall x. CompressionCodec -> Rep CompressionCodec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CompressionCodec -> Rep CompressionCodec x
from :: forall x. CompressionCodec -> Rep CompressionCodec x
$cto :: forall x. Rep CompressionCodec x -> CompressionCodec
to :: forall x. Rep CompressionCodec x -> CompressionCodec
Generic)

instance Pinchable CompressionCodec

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L261
data PageType
    = DATA_PAGE (Enumeration 0)
    | INDEX_PAGE (Enumeration 1)
    | DICTIONARY_PAGE (Enumeration 2)
    | DATA_PAGE_V2 (Enumeration 3)
    deriving (PageType -> PageType -> Bool
(PageType -> PageType -> Bool)
-> (PageType -> PageType -> Bool) -> Eq PageType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageType -> PageType -> Bool
== :: PageType -> PageType -> Bool
$c/= :: PageType -> PageType -> Bool
/= :: PageType -> PageType -> Bool
Eq, Int -> PageType -> ShowS
[PageType] -> ShowS
PageType -> String
(Int -> PageType -> ShowS)
-> (PageType -> String) -> ([PageType] -> ShowS) -> Show PageType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageType -> ShowS
showsPrec :: Int -> PageType -> ShowS
$cshow :: PageType -> String
show :: PageType -> String
$cshowList :: [PageType] -> ShowS
showList :: [PageType] -> ShowS
Show, (forall x. PageType -> Rep PageType x)
-> (forall x. Rep PageType x -> PageType) -> Generic PageType
forall x. Rep PageType x -> PageType
forall x. PageType -> Rep PageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PageType -> Rep PageType x
from :: forall x. PageType -> Rep PageType x
$cto :: forall x. Rep PageType x -> PageType
to :: forall x. Rep PageType x -> PageType
Generic)

instance Pinchable PageType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L271
data BoundaryOrder
    = UNORDERED (Enumeration 0)
    | ASCENDING (Enumeration 1)
    | DESCENDING (Enumeration 2)
    deriving (BoundaryOrder -> BoundaryOrder -> Bool
(BoundaryOrder -> BoundaryOrder -> Bool)
-> (BoundaryOrder -> BoundaryOrder -> Bool) -> Eq BoundaryOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BoundaryOrder -> BoundaryOrder -> Bool
== :: BoundaryOrder -> BoundaryOrder -> Bool
$c/= :: BoundaryOrder -> BoundaryOrder -> Bool
/= :: BoundaryOrder -> BoundaryOrder -> Bool
Eq, Int -> BoundaryOrder -> ShowS
[BoundaryOrder] -> ShowS
BoundaryOrder -> String
(Int -> BoundaryOrder -> ShowS)
-> (BoundaryOrder -> String)
-> ([BoundaryOrder] -> ShowS)
-> Show BoundaryOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BoundaryOrder -> ShowS
showsPrec :: Int -> BoundaryOrder -> ShowS
$cshow :: BoundaryOrder -> String
show :: BoundaryOrder -> String
$cshowList :: [BoundaryOrder] -> ShowS
showList :: [BoundaryOrder] -> ShowS
Show, (forall x. BoundaryOrder -> Rep BoundaryOrder x)
-> (forall x. Rep BoundaryOrder x -> BoundaryOrder)
-> Generic BoundaryOrder
forall x. Rep BoundaryOrder x -> BoundaryOrder
forall x. BoundaryOrder -> Rep BoundaryOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BoundaryOrder -> Rep BoundaryOrder x
from :: forall x. BoundaryOrder -> Rep BoundaryOrder x
$cto :: forall x. Rep BoundaryOrder x -> BoundaryOrder
to :: forall x. Rep BoundaryOrder x -> BoundaryOrder
Generic)

instance Pinchable BoundaryOrder

-- Logical type annotations
-- Empty structs can't use deriving Generic with Pinch, so we use a unit-like workaround.
-- We represent empty structs as a newtype over () with a manual Pinchable instance.

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L283
-- struct StringType {}
data StringType = StringType deriving (StringType -> StringType -> Bool
(StringType -> StringType -> Bool)
-> (StringType -> StringType -> Bool) -> Eq StringType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StringType -> StringType -> Bool
== :: StringType -> StringType -> Bool
$c/= :: StringType -> StringType -> Bool
/= :: StringType -> StringType -> Bool
Eq, Int -> StringType -> ShowS
[StringType] -> ShowS
StringType -> String
(Int -> StringType -> ShowS)
-> (StringType -> String)
-> ([StringType] -> ShowS)
-> Show StringType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StringType -> ShowS
showsPrec :: Int -> StringType -> ShowS
$cshow :: StringType -> String
show :: StringType -> String
$cshowList :: [StringType] -> ShowS
showList :: [StringType] -> ShowS
Show)
instance Pinchable StringType where
    type Tag StringType = Pinch.TStruct
    pinch :: StringType -> Value (Tag StringType)
pinch StringType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag StringType) -> Parser StringType
unpinch Value (Tag StringType)
_ = StringType -> Parser StringType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StringType
StringType

data UUIDType = UUIDType deriving (UUIDType -> UUIDType -> Bool
(UUIDType -> UUIDType -> Bool)
-> (UUIDType -> UUIDType -> Bool) -> Eq UUIDType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UUIDType -> UUIDType -> Bool
== :: UUIDType -> UUIDType -> Bool
$c/= :: UUIDType -> UUIDType -> Bool
/= :: UUIDType -> UUIDType -> Bool
Eq, Int -> UUIDType -> ShowS
[UUIDType] -> ShowS
UUIDType -> String
(Int -> UUIDType -> ShowS)
-> (UUIDType -> String) -> ([UUIDType] -> ShowS) -> Show UUIDType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UUIDType -> ShowS
showsPrec :: Int -> UUIDType -> ShowS
$cshow :: UUIDType -> String
show :: UUIDType -> String
$cshowList :: [UUIDType] -> ShowS
showList :: [UUIDType] -> ShowS
Show)
instance Pinchable UUIDType where
    type Tag UUIDType = Pinch.TStruct
    pinch :: UUIDType -> Value (Tag UUIDType)
pinch UUIDType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag UUIDType) -> Parser UUIDType
unpinch Value (Tag UUIDType)
_ = UUIDType -> Parser UUIDType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure UUIDType
UUIDType

data MapType = MapType deriving (MapType -> MapType -> Bool
(MapType -> MapType -> Bool)
-> (MapType -> MapType -> Bool) -> Eq MapType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MapType -> MapType -> Bool
== :: MapType -> MapType -> Bool
$c/= :: MapType -> MapType -> Bool
/= :: MapType -> MapType -> Bool
Eq, Int -> MapType -> ShowS
[MapType] -> ShowS
MapType -> String
(Int -> MapType -> ShowS)
-> (MapType -> String) -> ([MapType] -> ShowS) -> Show MapType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MapType -> ShowS
showsPrec :: Int -> MapType -> ShowS
$cshow :: MapType -> String
show :: MapType -> String
$cshowList :: [MapType] -> ShowS
showList :: [MapType] -> ShowS
Show)
instance Pinchable MapType where
    type Tag MapType = Pinch.TStruct
    pinch :: MapType -> Value (Tag MapType)
pinch MapType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag MapType) -> Parser MapType
unpinch Value (Tag MapType)
_ = MapType -> Parser MapType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MapType
MapType

data ListType = ListType deriving (ListType -> ListType -> Bool
(ListType -> ListType -> Bool)
-> (ListType -> ListType -> Bool) -> Eq ListType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListType -> ListType -> Bool
== :: ListType -> ListType -> Bool
$c/= :: ListType -> ListType -> Bool
/= :: ListType -> ListType -> Bool
Eq, Int -> ListType -> ShowS
[ListType] -> ShowS
ListType -> String
(Int -> ListType -> ShowS)
-> (ListType -> String) -> ([ListType] -> ShowS) -> Show ListType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListType -> ShowS
showsPrec :: Int -> ListType -> ShowS
$cshow :: ListType -> String
show :: ListType -> String
$cshowList :: [ListType] -> ShowS
showList :: [ListType] -> ShowS
Show)
instance Pinchable ListType where
    type Tag ListType = Pinch.TStruct
    pinch :: ListType -> Value (Tag ListType)
pinch ListType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag ListType) -> Parser ListType
unpinch Value (Tag ListType)
_ = ListType -> Parser ListType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ListType
ListType

data EnumType = EnumType deriving (EnumType -> EnumType -> Bool
(EnumType -> EnumType -> Bool)
-> (EnumType -> EnumType -> Bool) -> Eq EnumType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EnumType -> EnumType -> Bool
== :: EnumType -> EnumType -> Bool
$c/= :: EnumType -> EnumType -> Bool
/= :: EnumType -> EnumType -> Bool
Eq, Int -> EnumType -> ShowS
[EnumType] -> ShowS
EnumType -> String
(Int -> EnumType -> ShowS)
-> (EnumType -> String) -> ([EnumType] -> ShowS) -> Show EnumType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EnumType -> ShowS
showsPrec :: Int -> EnumType -> ShowS
$cshow :: EnumType -> String
show :: EnumType -> String
$cshowList :: [EnumType] -> ShowS
showList :: [EnumType] -> ShowS
Show)
instance Pinchable EnumType where
    type Tag EnumType = Pinch.TStruct
    pinch :: EnumType -> Value (Tag EnumType)
pinch EnumType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag EnumType) -> Parser EnumType
unpinch Value (Tag EnumType)
_ = EnumType -> Parser EnumType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure EnumType
EnumType

data DateType = DateType deriving (DateType -> DateType -> Bool
(DateType -> DateType -> Bool)
-> (DateType -> DateType -> Bool) -> Eq DateType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DateType -> DateType -> Bool
== :: DateType -> DateType -> Bool
$c/= :: DateType -> DateType -> Bool
/= :: DateType -> DateType -> Bool
Eq, Int -> DateType -> ShowS
[DateType] -> ShowS
DateType -> String
(Int -> DateType -> ShowS)
-> (DateType -> String) -> ([DateType] -> ShowS) -> Show DateType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DateType -> ShowS
showsPrec :: Int -> DateType -> ShowS
$cshow :: DateType -> String
show :: DateType -> String
$cshowList :: [DateType] -> ShowS
showList :: [DateType] -> ShowS
Show)
instance Pinchable DateType where
    type Tag DateType = Pinch.TStruct
    pinch :: DateType -> Value (Tag DateType)
pinch DateType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag DateType) -> Parser DateType
unpinch Value (Tag DateType)
_ = DateType -> Parser DateType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure DateType
DateType

data Float16Type = Float16Type deriving (Float16Type -> Float16Type -> Bool
(Float16Type -> Float16Type -> Bool)
-> (Float16Type -> Float16Type -> Bool) -> Eq Float16Type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Float16Type -> Float16Type -> Bool
== :: Float16Type -> Float16Type -> Bool
$c/= :: Float16Type -> Float16Type -> Bool
/= :: Float16Type -> Float16Type -> Bool
Eq, Int -> Float16Type -> ShowS
[Float16Type] -> ShowS
Float16Type -> String
(Int -> Float16Type -> ShowS)
-> (Float16Type -> String)
-> ([Float16Type] -> ShowS)
-> Show Float16Type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Float16Type -> ShowS
showsPrec :: Int -> Float16Type -> ShowS
$cshow :: Float16Type -> String
show :: Float16Type -> String
$cshowList :: [Float16Type] -> ShowS
showList :: [Float16Type] -> ShowS
Show)
instance Pinchable Float16Type where
    type Tag Float16Type = Pinch.TStruct
    pinch :: Float16Type -> Value (Tag Float16Type)
pinch Float16Type
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag Float16Type) -> Parser Float16Type
unpinch Value (Tag Float16Type)
_ = Float16Type -> Parser Float16Type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Float16Type
Float16Type

data NullType = NullType deriving (NullType -> NullType -> Bool
(NullType -> NullType -> Bool)
-> (NullType -> NullType -> Bool) -> Eq NullType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NullType -> NullType -> Bool
== :: NullType -> NullType -> Bool
$c/= :: NullType -> NullType -> Bool
/= :: NullType -> NullType -> Bool
Eq, Int -> NullType -> ShowS
[NullType] -> ShowS
NullType -> String
(Int -> NullType -> ShowS)
-> (NullType -> String) -> ([NullType] -> ShowS) -> Show NullType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NullType -> ShowS
showsPrec :: Int -> NullType -> ShowS
$cshow :: NullType -> String
show :: NullType -> String
$cshowList :: [NullType] -> ShowS
showList :: [NullType] -> ShowS
Show)
instance Pinchable NullType where
    type Tag NullType = Pinch.TStruct
    pinch :: NullType -> Value (Tag NullType)
pinch NullType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag NullType) -> Parser NullType
unpinch Value (Tag NullType)
_ = NullType -> Parser NullType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure NullType
NullType

data JsonType = JsonType deriving (JsonType -> JsonType -> Bool
(JsonType -> JsonType -> Bool)
-> (JsonType -> JsonType -> Bool) -> Eq JsonType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: JsonType -> JsonType -> Bool
== :: JsonType -> JsonType -> Bool
$c/= :: JsonType -> JsonType -> Bool
/= :: JsonType -> JsonType -> Bool
Eq, Int -> JsonType -> ShowS
[JsonType] -> ShowS
JsonType -> String
(Int -> JsonType -> ShowS)
-> (JsonType -> String) -> ([JsonType] -> ShowS) -> Show JsonType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> JsonType -> ShowS
showsPrec :: Int -> JsonType -> ShowS
$cshow :: JsonType -> String
show :: JsonType -> String
$cshowList :: [JsonType] -> ShowS
showList :: [JsonType] -> ShowS
Show)
instance Pinchable JsonType where
    type Tag JsonType = Pinch.TStruct
    pinch :: JsonType -> Value (Tag JsonType)
pinch JsonType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag JsonType) -> Parser JsonType
unpinch Value (Tag JsonType)
_ = JsonType -> Parser JsonType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure JsonType
JsonType

data BsonType = BsonType deriving (BsonType -> BsonType -> Bool
(BsonType -> BsonType -> Bool)
-> (BsonType -> BsonType -> Bool) -> Eq BsonType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BsonType -> BsonType -> Bool
== :: BsonType -> BsonType -> Bool
$c/= :: BsonType -> BsonType -> Bool
/= :: BsonType -> BsonType -> Bool
Eq, Int -> BsonType -> ShowS
[BsonType] -> ShowS
BsonType -> String
(Int -> BsonType -> ShowS)
-> (BsonType -> String) -> ([BsonType] -> ShowS) -> Show BsonType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BsonType -> ShowS
showsPrec :: Int -> BsonType -> ShowS
$cshow :: BsonType -> String
show :: BsonType -> String
$cshowList :: [BsonType] -> ShowS
showList :: [BsonType] -> ShowS
Show)
instance Pinchable BsonType where
    type Tag BsonType = Pinch.TStruct
    pinch :: BsonType -> Value (Tag BsonType)
pinch BsonType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag BsonType) -> Parser BsonType
unpinch Value (Tag BsonType)
_ = BsonType -> Parser BsonType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure BsonType
BsonType

data VariantType = VariantType deriving (VariantType -> VariantType -> Bool
(VariantType -> VariantType -> Bool)
-> (VariantType -> VariantType -> Bool) -> Eq VariantType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VariantType -> VariantType -> Bool
== :: VariantType -> VariantType -> Bool
$c/= :: VariantType -> VariantType -> Bool
/= :: VariantType -> VariantType -> Bool
Eq, Int -> VariantType -> ShowS
[VariantType] -> ShowS
VariantType -> String
(Int -> VariantType -> ShowS)
-> (VariantType -> String)
-> ([VariantType] -> ShowS)
-> Show VariantType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VariantType -> ShowS
showsPrec :: Int -> VariantType -> ShowS
$cshow :: VariantType -> String
show :: VariantType -> String
$cshowList :: [VariantType] -> ShowS
showList :: [VariantType] -> ShowS
Show)
instance Pinchable VariantType where
    type Tag VariantType = Pinch.TStruct
    pinch :: VariantType -> Value (Tag VariantType)
pinch VariantType
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag VariantType) -> Parser VariantType
unpinch Value (Tag VariantType)
_ = VariantType -> Parser VariantType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure VariantType
VariantType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L290
data TimeUnit
    = MILLIS (Field 1 MilliSeconds)
    | MICROS (Field 2 MicroSeconds)
    | NANOS (Field 3 NanoSeconds)
    deriving (TimeUnit -> TimeUnit -> Bool
(TimeUnit -> TimeUnit -> Bool)
-> (TimeUnit -> TimeUnit -> Bool) -> Eq TimeUnit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimeUnit -> TimeUnit -> Bool
== :: TimeUnit -> TimeUnit -> Bool
$c/= :: TimeUnit -> TimeUnit -> Bool
/= :: TimeUnit -> TimeUnit -> Bool
Eq, Int -> TimeUnit -> ShowS
[TimeUnit] -> ShowS
TimeUnit -> String
(Int -> TimeUnit -> ShowS)
-> (TimeUnit -> String) -> ([TimeUnit] -> ShowS) -> Show TimeUnit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TimeUnit -> ShowS
showsPrec :: Int -> TimeUnit -> ShowS
$cshow :: TimeUnit -> String
show :: TimeUnit -> String
$cshowList :: [TimeUnit] -> ShowS
showList :: [TimeUnit] -> ShowS
Show, (forall x. TimeUnit -> Rep TimeUnit x)
-> (forall x. Rep TimeUnit x -> TimeUnit) -> Generic TimeUnit
forall x. Rep TimeUnit x -> TimeUnit
forall x. TimeUnit -> Rep TimeUnit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TimeUnit -> Rep TimeUnit x
from :: forall x. TimeUnit -> Rep TimeUnit x
$cto :: forall x. Rep TimeUnit x -> TimeUnit
to :: forall x. Rep TimeUnit x -> TimeUnit
Generic)

instance Pinchable TimeUnit

data MilliSeconds = MilliSeconds deriving (MilliSeconds -> MilliSeconds -> Bool
(MilliSeconds -> MilliSeconds -> Bool)
-> (MilliSeconds -> MilliSeconds -> Bool) -> Eq MilliSeconds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MilliSeconds -> MilliSeconds -> Bool
== :: MilliSeconds -> MilliSeconds -> Bool
$c/= :: MilliSeconds -> MilliSeconds -> Bool
/= :: MilliSeconds -> MilliSeconds -> Bool
Eq, Int -> MilliSeconds -> ShowS
[MilliSeconds] -> ShowS
MilliSeconds -> String
(Int -> MilliSeconds -> ShowS)
-> (MilliSeconds -> String)
-> ([MilliSeconds] -> ShowS)
-> Show MilliSeconds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MilliSeconds -> ShowS
showsPrec :: Int -> MilliSeconds -> ShowS
$cshow :: MilliSeconds -> String
show :: MilliSeconds -> String
$cshowList :: [MilliSeconds] -> ShowS
showList :: [MilliSeconds] -> ShowS
Show)
instance Pinchable MilliSeconds where
    type Tag MilliSeconds = Pinch.TStruct
    pinch :: MilliSeconds -> Value (Tag MilliSeconds)
pinch MilliSeconds
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag MilliSeconds) -> Parser MilliSeconds
unpinch Value (Tag MilliSeconds)
_ = MilliSeconds -> Parser MilliSeconds
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MilliSeconds
MilliSeconds

data MicroSeconds = MicroSeconds deriving (MicroSeconds -> MicroSeconds -> Bool
(MicroSeconds -> MicroSeconds -> Bool)
-> (MicroSeconds -> MicroSeconds -> Bool) -> Eq MicroSeconds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MicroSeconds -> MicroSeconds -> Bool
== :: MicroSeconds -> MicroSeconds -> Bool
$c/= :: MicroSeconds -> MicroSeconds -> Bool
/= :: MicroSeconds -> MicroSeconds -> Bool
Eq, Int -> MicroSeconds -> ShowS
[MicroSeconds] -> ShowS
MicroSeconds -> String
(Int -> MicroSeconds -> ShowS)
-> (MicroSeconds -> String)
-> ([MicroSeconds] -> ShowS)
-> Show MicroSeconds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MicroSeconds -> ShowS
showsPrec :: Int -> MicroSeconds -> ShowS
$cshow :: MicroSeconds -> String
show :: MicroSeconds -> String
$cshowList :: [MicroSeconds] -> ShowS
showList :: [MicroSeconds] -> ShowS
Show)
instance Pinchable MicroSeconds where
    type Tag MicroSeconds = Pinch.TStruct
    pinch :: MicroSeconds -> Value (Tag MicroSeconds)
pinch MicroSeconds
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag MicroSeconds) -> Parser MicroSeconds
unpinch Value (Tag MicroSeconds)
_ = MicroSeconds -> Parser MicroSeconds
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MicroSeconds
MicroSeconds

data NanoSeconds = NanoSeconds deriving (NanoSeconds -> NanoSeconds -> Bool
(NanoSeconds -> NanoSeconds -> Bool)
-> (NanoSeconds -> NanoSeconds -> Bool) -> Eq NanoSeconds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NanoSeconds -> NanoSeconds -> Bool
== :: NanoSeconds -> NanoSeconds -> Bool
$c/= :: NanoSeconds -> NanoSeconds -> Bool
/= :: NanoSeconds -> NanoSeconds -> Bool
Eq, Int -> NanoSeconds -> ShowS
[NanoSeconds] -> ShowS
NanoSeconds -> String
(Int -> NanoSeconds -> ShowS)
-> (NanoSeconds -> String)
-> ([NanoSeconds] -> ShowS)
-> Show NanoSeconds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NanoSeconds -> ShowS
showsPrec :: Int -> NanoSeconds -> ShowS
$cshow :: NanoSeconds -> String
show :: NanoSeconds -> String
$cshowList :: [NanoSeconds] -> ShowS
showList :: [NanoSeconds] -> ShowS
Show)
instance Pinchable NanoSeconds where
    type Tag NanoSeconds = Pinch.TStruct
    pinch :: NanoSeconds -> Value (Tag NanoSeconds)
pinch NanoSeconds
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag NanoSeconds) -> Parser NanoSeconds
unpinch Value (Tag NanoSeconds)
_ = NanoSeconds -> Parser NanoSeconds
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure NanoSeconds
NanoSeconds

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L317
data DecimalType
    = DecimalType
    { DecimalType -> Field 1 Int32
decimal_scale :: Field 1 Int32
    , DecimalType -> Field 2 Int32
decimal_precision :: Field 2 Int32
    }
    deriving (DecimalType -> DecimalType -> Bool
(DecimalType -> DecimalType -> Bool)
-> (DecimalType -> DecimalType -> Bool) -> Eq DecimalType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DecimalType -> DecimalType -> Bool
== :: DecimalType -> DecimalType -> Bool
$c/= :: DecimalType -> DecimalType -> Bool
/= :: DecimalType -> DecimalType -> Bool
Eq, Int -> DecimalType -> ShowS
[DecimalType] -> ShowS
DecimalType -> String
(Int -> DecimalType -> ShowS)
-> (DecimalType -> String)
-> ([DecimalType] -> ShowS)
-> Show DecimalType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DecimalType -> ShowS
showsPrec :: Int -> DecimalType -> ShowS
$cshow :: DecimalType -> String
show :: DecimalType -> String
$cshowList :: [DecimalType] -> ShowS
showList :: [DecimalType] -> ShowS
Show, (forall x. DecimalType -> Rep DecimalType x)
-> (forall x. Rep DecimalType x -> DecimalType)
-> Generic DecimalType
forall x. Rep DecimalType x -> DecimalType
forall x. DecimalType -> Rep DecimalType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DecimalType -> Rep DecimalType x
from :: forall x. DecimalType -> Rep DecimalType x
$cto :: forall x. Rep DecimalType x -> DecimalType
to :: forall x. Rep DecimalType x -> DecimalType
Generic)

instance Pinchable DecimalType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L328
data IntType
    = IntType
    { IntType -> Field 1 Int8
int_bitWidth :: Field 1 Int8
    , IntType -> Field 2 Bool
int_isSigned :: Field 2 Bool
    }
    deriving (IntType -> IntType -> Bool
(IntType -> IntType -> Bool)
-> (IntType -> IntType -> Bool) -> Eq IntType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IntType -> IntType -> Bool
== :: IntType -> IntType -> Bool
$c/= :: IntType -> IntType -> Bool
/= :: IntType -> IntType -> Bool
Eq, Int -> IntType -> ShowS
[IntType] -> ShowS
IntType -> String
(Int -> IntType -> ShowS)
-> (IntType -> String) -> ([IntType] -> ShowS) -> Show IntType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IntType -> ShowS
showsPrec :: Int -> IntType -> ShowS
$cshow :: IntType -> String
show :: IntType -> String
$cshowList :: [IntType] -> ShowS
showList :: [IntType] -> ShowS
Show, (forall x. IntType -> Rep IntType x)
-> (forall x. Rep IntType x -> IntType) -> Generic IntType
forall x. Rep IntType x -> IntType
forall x. IntType -> Rep IntType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IntType -> Rep IntType x
from :: forall x. IntType -> Rep IntType x
$cto :: forall x. Rep IntType x -> IntType
to :: forall x. Rep IntType x -> IntType
Generic)

instance Pinchable IntType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L338
data TimeType
    = TimeType
    { TimeType -> Field 1 Bool
time_isAdjustedToUTC :: Field 1 Bool
    , TimeType -> Field 2 TimeUnit
time_unit :: Field 2 TimeUnit
    }
    deriving (TimeType -> TimeType -> Bool
(TimeType -> TimeType -> Bool)
-> (TimeType -> TimeType -> Bool) -> Eq TimeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimeType -> TimeType -> Bool
== :: TimeType -> TimeType -> Bool
$c/= :: TimeType -> TimeType -> Bool
/= :: TimeType -> TimeType -> Bool
Eq, Int -> TimeType -> ShowS
[TimeType] -> ShowS
TimeType -> String
(Int -> TimeType -> ShowS)
-> (TimeType -> String) -> ([TimeType] -> ShowS) -> Show TimeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TimeType -> ShowS
showsPrec :: Int -> TimeType -> ShowS
$cshow :: TimeType -> String
show :: TimeType -> String
$cshowList :: [TimeType] -> ShowS
showList :: [TimeType] -> ShowS
Show, (forall x. TimeType -> Rep TimeType x)
-> (forall x. Rep TimeType x -> TimeType) -> Generic TimeType
forall x. Rep TimeType x -> TimeType
forall x. TimeType -> Rep TimeType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TimeType -> Rep TimeType x
from :: forall x. TimeType -> Rep TimeType x
$cto :: forall x. Rep TimeType x -> TimeType
to :: forall x. Rep TimeType x -> TimeType
Generic)

instance Pinchable TimeType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L349
data TimestampType
    = TimestampType
    { TimestampType -> Field 1 Bool
timestamp_isAdjustedToUTC :: Field 1 Bool
    , TimestampType -> Field 2 TimeUnit
timestamp_unit :: Field 2 TimeUnit
    }
    deriving (TimestampType -> TimestampType -> Bool
(TimestampType -> TimestampType -> Bool)
-> (TimestampType -> TimestampType -> Bool) -> Eq TimestampType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TimestampType -> TimestampType -> Bool
== :: TimestampType -> TimestampType -> Bool
$c/= :: TimestampType -> TimestampType -> Bool
/= :: TimestampType -> TimestampType -> Bool
Eq, Int -> TimestampType -> ShowS
[TimestampType] -> ShowS
TimestampType -> String
(Int -> TimestampType -> ShowS)
-> (TimestampType -> String)
-> ([TimestampType] -> ShowS)
-> Show TimestampType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TimestampType -> ShowS
showsPrec :: Int -> TimestampType -> ShowS
$cshow :: TimestampType -> String
show :: TimestampType -> String
$cshowList :: [TimestampType] -> ShowS
showList :: [TimestampType] -> ShowS
Show, (forall x. TimestampType -> Rep TimestampType x)
-> (forall x. Rep TimestampType x -> TimestampType)
-> Generic TimestampType
forall x. Rep TimestampType x -> TimestampType
forall x. TimestampType -> Rep TimestampType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TimestampType -> Rep TimestampType x
from :: forall x. TimestampType -> Rep TimestampType x
$cto :: forall x. Rep TimestampType x -> TimestampType
to :: forall x. Rep TimestampType x -> TimestampType
Generic)

instance Pinchable TimestampType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L360
-- union LogicalType
data LogicalType
    = LT_STRING (Field 1 StringType)
    | LT_MAP (Field 2 MapType)
    | LT_LIST (Field 3 ListType)
    | LT_ENUM (Field 4 EnumType)
    | LT_DECIMAL (Field 5 DecimalType)
    | LT_DATE (Field 6 DateType)
    | LT_TIME (Field 7 TimeType)
    | LT_TIMESTAMP (Field 8 TimestampType)
    | LT_INTEGER (Field 10 IntType)
    | LT_NULL (Field 11 NullType)
    | LT_JSON (Field 12 JsonType)
    | LT_BSON (Field 13 BsonType)
    | LT_UUID (Field 14 UUIDType)
    | LT_FLOAT16 (Field 15 Float16Type)
    | LT_VARIANT (Field 16 VariantType)
    deriving (LogicalType -> LogicalType -> Bool
(LogicalType -> LogicalType -> Bool)
-> (LogicalType -> LogicalType -> Bool) -> Eq LogicalType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LogicalType -> LogicalType -> Bool
== :: LogicalType -> LogicalType -> Bool
$c/= :: LogicalType -> LogicalType -> Bool
/= :: LogicalType -> LogicalType -> Bool
Eq, Int -> LogicalType -> ShowS
[LogicalType] -> ShowS
LogicalType -> String
(Int -> LogicalType -> ShowS)
-> (LogicalType -> String)
-> ([LogicalType] -> ShowS)
-> Show LogicalType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LogicalType -> ShowS
showsPrec :: Int -> LogicalType -> ShowS
$cshow :: LogicalType -> String
show :: LogicalType -> String
$cshowList :: [LogicalType] -> ShowS
showList :: [LogicalType] -> ShowS
Show, (forall x. LogicalType -> Rep LogicalType x)
-> (forall x. Rep LogicalType x -> LogicalType)
-> Generic LogicalType
forall x. Rep LogicalType x -> LogicalType
forall x. LogicalType -> Rep LogicalType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. LogicalType -> Rep LogicalType x
from :: forall x. LogicalType -> Rep LogicalType x
$cto :: forall x. Rep LogicalType x -> LogicalType
to :: forall x. Rep LogicalType x -> LogicalType
Generic)

instance Pinchable LogicalType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L270
data ConvertedType
    = UTF8 (Enumeration 0)
    | MAP (Enumeration 1)
    | MAP_KEY_VALUE (Enumeration 2)
    | LIST (Enumeration 3)
    | ENUM (Enumeration 4)
    | DECIMAL (Enumeration 5)
    | DATE (Enumeration 6)
    | TIME_MILLIS (Enumeration 7)
    | TIME_MICROS (Enumeration 8)
    | TIMESTAMP_MILLIS (Enumeration 9)
    | TIMESTAMP_MICROS (Enumeration 10)
    | UINT_8 (Enumeration 11)
    | UINT_16 (Enumeration 12)
    | UINT_32 (Enumeration 13)
    | UINT_64 (Enumeration 14)
    | INT_8 (Enumeration 15)
    | INT_16 (Enumeration 16)
    | INT_32 (Enumeration 17)
    | INT_64 (Enumeration 18)
    | JSON (Enumeration 19)
    | BSON (Enumeration 20)
    | INTERVAL (Enumeration 21)
    deriving (ConvertedType -> ConvertedType -> Bool
(ConvertedType -> ConvertedType -> Bool)
-> (ConvertedType -> ConvertedType -> Bool) -> Eq ConvertedType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConvertedType -> ConvertedType -> Bool
== :: ConvertedType -> ConvertedType -> Bool
$c/= :: ConvertedType -> ConvertedType -> Bool
/= :: ConvertedType -> ConvertedType -> Bool
Eq, Int -> ConvertedType -> ShowS
[ConvertedType] -> ShowS
ConvertedType -> String
(Int -> ConvertedType -> ShowS)
-> (ConvertedType -> String)
-> ([ConvertedType] -> ShowS)
-> Show ConvertedType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConvertedType -> ShowS
showsPrec :: Int -> ConvertedType -> ShowS
$cshow :: ConvertedType -> String
show :: ConvertedType -> String
$cshowList :: [ConvertedType] -> ShowS
showList :: [ConvertedType] -> ShowS
Show, (forall x. ConvertedType -> Rep ConvertedType x)
-> (forall x. Rep ConvertedType x -> ConvertedType)
-> Generic ConvertedType
forall x. Rep ConvertedType x -> ConvertedType
forall x. ConvertedType -> Rep ConvertedType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConvertedType -> Rep ConvertedType x
from :: forall x. ConvertedType -> Rep ConvertedType x
$cto :: forall x. Rep ConvertedType x -> ConvertedType
to :: forall x. Rep ConvertedType x -> ConvertedType
Generic)

instance Pinchable ConvertedType

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L505
data SchemaElement
    = SchemaElement
    { SchemaElement -> Field 1 (Maybe ThriftType)
schematype :: Field 1 (Maybe ThriftType) -- called just type in parquet.thrift
    , SchemaElement -> Field 2 (Maybe Int32)
type_length :: Field 2 (Maybe Int32)
    , SchemaElement -> Field 3 (Maybe FieldRepetitionType)
repetition_type :: Field 3 (Maybe FieldRepetitionType)
    , SchemaElement -> Field 4 Text
name :: Field 4 Text
    , SchemaElement -> Field 5 (Maybe Int32)
num_children :: Field 5 (Maybe Int32)
    , SchemaElement -> Field 6 (Maybe ConvertedType)
converted_type :: Field 6 (Maybe ConvertedType)
    , SchemaElement -> Field 7 (Maybe Int32)
scale :: Field 7 (Maybe Int32)
    , SchemaElement -> Field 8 (Maybe Int32)
precision :: Field 8 (Maybe Int32)
    , SchemaElement -> Field 9 (Maybe Int32)
field_id :: Field 9 (Maybe Int32)
    , SchemaElement -> Field 10 (Maybe LogicalType)
logicalType :: Field 10 (Maybe LogicalType)
    }
    deriving (SchemaElement -> SchemaElement -> Bool
(SchemaElement -> SchemaElement -> Bool)
-> (SchemaElement -> SchemaElement -> Bool) -> Eq SchemaElement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SchemaElement -> SchemaElement -> Bool
== :: SchemaElement -> SchemaElement -> Bool
$c/= :: SchemaElement -> SchemaElement -> Bool
/= :: SchemaElement -> SchemaElement -> Bool
Eq, Int -> SchemaElement -> ShowS
[SchemaElement] -> ShowS
SchemaElement -> String
(Int -> SchemaElement -> ShowS)
-> (SchemaElement -> String)
-> ([SchemaElement] -> ShowS)
-> Show SchemaElement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SchemaElement -> ShowS
showsPrec :: Int -> SchemaElement -> ShowS
$cshow :: SchemaElement -> String
show :: SchemaElement -> String
$cshowList :: [SchemaElement] -> ShowS
showList :: [SchemaElement] -> ShowS
Show, (forall x. SchemaElement -> Rep SchemaElement x)
-> (forall x. Rep SchemaElement x -> SchemaElement)
-> Generic SchemaElement
forall x. Rep SchemaElement x -> SchemaElement
forall x. SchemaElement -> Rep SchemaElement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SchemaElement -> Rep SchemaElement x
from :: forall x. SchemaElement -> Rep SchemaElement x
$cto :: forall x. Rep SchemaElement x -> SchemaElement
to :: forall x. Rep SchemaElement x -> SchemaElement
Generic)

instance Pinchable SchemaElement

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L560
data Statistics
    = Statistics
    { Statistics -> Field 1 (Maybe ByteString)
stats_max :: Field 1 (Maybe ByteString)
    , Statistics -> Field 2 (Maybe ByteString)
stats_min :: Field 2 (Maybe ByteString)
    , Statistics -> Field 3 (Maybe Int64)
stats_null_count :: Field 3 (Maybe Int64)
    , Statistics -> Field 4 (Maybe Int64)
stats_distinct_count :: Field 4 (Maybe Int64)
    , Statistics -> Field 5 (Maybe ByteString)
stats_max_value :: Field 5 (Maybe ByteString)
    , Statistics -> Field 6 (Maybe ByteString)
stats_min_value :: Field 6 (Maybe ByteString)
    , Statistics -> Field 7 (Maybe Bool)
stats_is_max_value_exact :: Field 7 (Maybe Bool)
    , Statistics -> Field 8 (Maybe Bool)
stats_is_min_value_exact :: Field 8 (Maybe Bool)
    }
    deriving (Statistics -> Statistics -> Bool
(Statistics -> Statistics -> Bool)
-> (Statistics -> Statistics -> Bool) -> Eq Statistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Statistics -> Statistics -> Bool
== :: Statistics -> Statistics -> Bool
$c/= :: Statistics -> Statistics -> Bool
/= :: Statistics -> Statistics -> Bool
Eq, Int -> Statistics -> ShowS
[Statistics] -> ShowS
Statistics -> String
(Int -> Statistics -> ShowS)
-> (Statistics -> String)
-> ([Statistics] -> ShowS)
-> Show Statistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Statistics -> ShowS
showsPrec :: Int -> Statistics -> ShowS
$cshow :: Statistics -> String
show :: Statistics -> String
$cshowList :: [Statistics] -> ShowS
showList :: [Statistics] -> ShowS
Show, (forall x. Statistics -> Rep Statistics x)
-> (forall x. Rep Statistics x -> Statistics) -> Generic Statistics
forall x. Rep Statistics x -> Statistics
forall x. Statistics -> Rep Statistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Statistics -> Rep Statistics x
from :: forall x. Statistics -> Rep Statistics x
$cto :: forall x. Rep Statistics x -> Statistics
to :: forall x. Rep Statistics x -> Statistics
Generic)

instance Pinchable Statistics

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L600
data PageEncodingStats
    = PageEncodingStats
    { PageEncodingStats -> Field 1 PageType
pes_page_type :: Field 1 PageType
    , PageEncodingStats -> Field 2 Encoding
pes_encoding :: Field 2 Encoding
    , PageEncodingStats -> Field 3 Int32
pes_count :: Field 3 Int32
    }
    deriving (PageEncodingStats -> PageEncodingStats -> Bool
(PageEncodingStats -> PageEncodingStats -> Bool)
-> (PageEncodingStats -> PageEncodingStats -> Bool)
-> Eq PageEncodingStats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageEncodingStats -> PageEncodingStats -> Bool
== :: PageEncodingStats -> PageEncodingStats -> Bool
$c/= :: PageEncodingStats -> PageEncodingStats -> Bool
/= :: PageEncodingStats -> PageEncodingStats -> Bool
Eq, Int -> PageEncodingStats -> ShowS
[PageEncodingStats] -> ShowS
PageEncodingStats -> String
(Int -> PageEncodingStats -> ShowS)
-> (PageEncodingStats -> String)
-> ([PageEncodingStats] -> ShowS)
-> Show PageEncodingStats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageEncodingStats -> ShowS
showsPrec :: Int -> PageEncodingStats -> ShowS
$cshow :: PageEncodingStats -> String
show :: PageEncodingStats -> String
$cshowList :: [PageEncodingStats] -> ShowS
showList :: [PageEncodingStats] -> ShowS
Show, (forall x. PageEncodingStats -> Rep PageEncodingStats x)
-> (forall x. Rep PageEncodingStats x -> PageEncodingStats)
-> Generic PageEncodingStats
forall x. Rep PageEncodingStats x -> PageEncodingStats
forall x. PageEncodingStats -> Rep PageEncodingStats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PageEncodingStats -> Rep PageEncodingStats x
from :: forall x. PageEncodingStats -> Rep PageEncodingStats x
$cto :: forall x. Rep PageEncodingStats x -> PageEncodingStats
to :: forall x. Rep PageEncodingStats x -> PageEncodingStats
Generic)

instance Pinchable PageEncodingStats

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L614
data ColumnMetaData
    = ColumnMetaData
    { ColumnMetaData -> Field 1 ThriftType
cmd_type :: Field 1 ThriftType
    , ColumnMetaData -> Field 2 [Encoding]
cmd_encodings :: Field 2 [Encoding]
    , ColumnMetaData -> Field 3 [Text]
cmd_path_in_schema :: Field 3 [Text]
    , ColumnMetaData -> Field 4 CompressionCodec
cmd_codec :: Field 4 CompressionCodec
    , ColumnMetaData -> Field 5 Int64
cmd_num_values :: Field 5 Int64
    , ColumnMetaData -> Field 6 Int64
cmd_total_uncompressed_size :: Field 6 Int64
    , ColumnMetaData -> Field 7 Int64
cmd_total_compressed_size :: Field 7 Int64
    , ColumnMetaData -> Field 8 (Maybe [KeyValue])
cmd_key_value_metadata :: Field 8 (Maybe [KeyValue])
    , ColumnMetaData -> Field 9 Int64
cmd_data_page_offset :: Field 9 Int64
    , ColumnMetaData -> Field 10 (Maybe Int64)
cmd_index_page_offset :: Field 10 (Maybe Int64)
    , ColumnMetaData -> Field 11 (Maybe Int64)
cmd_dictionary_page_offset :: Field 11 (Maybe Int64)
    , ColumnMetaData -> Field 12 (Maybe Statistics)
cmd_statistics :: Field 12 (Maybe Statistics)
    , ColumnMetaData -> Field 13 (Maybe [PageEncodingStats])
cmd_encoding_stats :: Field 13 (Maybe [PageEncodingStats])
    , ColumnMetaData -> Field 14 (Maybe Int64)
cmd_bloom_filter_offset :: Field 14 (Maybe Int64)
    , ColumnMetaData -> Field 15 (Maybe Int32)
cmd_bloom_filter_length :: Field 15 (Maybe Int32)
    }
    deriving (ColumnMetaData -> ColumnMetaData -> Bool
(ColumnMetaData -> ColumnMetaData -> Bool)
-> (ColumnMetaData -> ColumnMetaData -> Bool) -> Eq ColumnMetaData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnMetaData -> ColumnMetaData -> Bool
== :: ColumnMetaData -> ColumnMetaData -> Bool
$c/= :: ColumnMetaData -> ColumnMetaData -> Bool
/= :: ColumnMetaData -> ColumnMetaData -> Bool
Eq, Int -> ColumnMetaData -> ShowS
[ColumnMetaData] -> ShowS
ColumnMetaData -> String
(Int -> ColumnMetaData -> ShowS)
-> (ColumnMetaData -> String)
-> ([ColumnMetaData] -> ShowS)
-> Show ColumnMetaData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnMetaData -> ShowS
showsPrec :: Int -> ColumnMetaData -> ShowS
$cshow :: ColumnMetaData -> String
show :: ColumnMetaData -> String
$cshowList :: [ColumnMetaData] -> ShowS
showList :: [ColumnMetaData] -> ShowS
Show, (forall x. ColumnMetaData -> Rep ColumnMetaData x)
-> (forall x. Rep ColumnMetaData x -> ColumnMetaData)
-> Generic ColumnMetaData
forall x. Rep ColumnMetaData x -> ColumnMetaData
forall x. ColumnMetaData -> Rep ColumnMetaData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColumnMetaData -> Rep ColumnMetaData x
from :: forall x. ColumnMetaData -> Rep ColumnMetaData x
$cto :: forall x. Rep ColumnMetaData x -> ColumnMetaData
to :: forall x. Rep ColumnMetaData x -> ColumnMetaData
Generic)

instance Pinchable ColumnMetaData

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L875
data EncryptionWithFooterKey = EncryptionWithFooterKey deriving (EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool
(EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool)
-> (EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool)
-> Eq EncryptionWithFooterKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool
== :: EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool
$c/= :: EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool
/= :: EncryptionWithFooterKey -> EncryptionWithFooterKey -> Bool
Eq, Int -> EncryptionWithFooterKey -> ShowS
[EncryptionWithFooterKey] -> ShowS
EncryptionWithFooterKey -> String
(Int -> EncryptionWithFooterKey -> ShowS)
-> (EncryptionWithFooterKey -> String)
-> ([EncryptionWithFooterKey] -> ShowS)
-> Show EncryptionWithFooterKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EncryptionWithFooterKey -> ShowS
showsPrec :: Int -> EncryptionWithFooterKey -> ShowS
$cshow :: EncryptionWithFooterKey -> String
show :: EncryptionWithFooterKey -> String
$cshowList :: [EncryptionWithFooterKey] -> ShowS
showList :: [EncryptionWithFooterKey] -> ShowS
Show)
instance Pinchable EncryptionWithFooterKey where
    type Tag EncryptionWithFooterKey = Pinch.TStruct
    pinch :: EncryptionWithFooterKey -> Value (Tag EncryptionWithFooterKey)
pinch EncryptionWithFooterKey
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag EncryptionWithFooterKey)
-> Parser EncryptionWithFooterKey
unpinch Value (Tag EncryptionWithFooterKey)
_ = EncryptionWithFooterKey -> Parser EncryptionWithFooterKey
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure EncryptionWithFooterKey
EncryptionWithFooterKey

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L883
data EncryptionWithColumnKey
    = EncryptionWithColumnKey
    { EncryptionWithColumnKey -> Field 1 [Text]
ewck_path_in_schema :: Field 1 [Text]
    , EncryptionWithColumnKey -> Field 2 (Maybe ByteString)
ewck_key_metadata :: Field 2 (Maybe ByteString)
    }
    deriving (EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool
(EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool)
-> (EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool)
-> Eq EncryptionWithColumnKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool
== :: EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool
$c/= :: EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool
/= :: EncryptionWithColumnKey -> EncryptionWithColumnKey -> Bool
Eq, Int -> EncryptionWithColumnKey -> ShowS
[EncryptionWithColumnKey] -> ShowS
EncryptionWithColumnKey -> String
(Int -> EncryptionWithColumnKey -> ShowS)
-> (EncryptionWithColumnKey -> String)
-> ([EncryptionWithColumnKey] -> ShowS)
-> Show EncryptionWithColumnKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EncryptionWithColumnKey -> ShowS
showsPrec :: Int -> EncryptionWithColumnKey -> ShowS
$cshow :: EncryptionWithColumnKey -> String
show :: EncryptionWithColumnKey -> String
$cshowList :: [EncryptionWithColumnKey] -> ShowS
showList :: [EncryptionWithColumnKey] -> ShowS
Show, (forall x.
 EncryptionWithColumnKey -> Rep EncryptionWithColumnKey x)
-> (forall x.
    Rep EncryptionWithColumnKey x -> EncryptionWithColumnKey)
-> Generic EncryptionWithColumnKey
forall x. Rep EncryptionWithColumnKey x -> EncryptionWithColumnKey
forall x. EncryptionWithColumnKey -> Rep EncryptionWithColumnKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EncryptionWithColumnKey -> Rep EncryptionWithColumnKey x
from :: forall x. EncryptionWithColumnKey -> Rep EncryptionWithColumnKey x
$cto :: forall x. Rep EncryptionWithColumnKey x -> EncryptionWithColumnKey
to :: forall x. Rep EncryptionWithColumnKey x -> EncryptionWithColumnKey
Generic)

instance Pinchable EncryptionWithColumnKey

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L893
-- union ColumnCryptoMetaData
data ColumnCryptoMetaData
    = CCM_ENCRYPTION_WITH_FOOTER_KEY (Field 1 EncryptionWithFooterKey)
    | CCM_ENCRYPTION_WITH_COLUMN_KEY (Field 2 EncryptionWithColumnKey)
    deriving (ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool
(ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool)
-> (ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool)
-> Eq ColumnCryptoMetaData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool
== :: ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool
$c/= :: ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool
/= :: ColumnCryptoMetaData -> ColumnCryptoMetaData -> Bool
Eq, Int -> ColumnCryptoMetaData -> ShowS
[ColumnCryptoMetaData] -> ShowS
ColumnCryptoMetaData -> String
(Int -> ColumnCryptoMetaData -> ShowS)
-> (ColumnCryptoMetaData -> String)
-> ([ColumnCryptoMetaData] -> ShowS)
-> Show ColumnCryptoMetaData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnCryptoMetaData -> ShowS
showsPrec :: Int -> ColumnCryptoMetaData -> ShowS
$cshow :: ColumnCryptoMetaData -> String
show :: ColumnCryptoMetaData -> String
$cshowList :: [ColumnCryptoMetaData] -> ShowS
showList :: [ColumnCryptoMetaData] -> ShowS
Show, (forall x. ColumnCryptoMetaData -> Rep ColumnCryptoMetaData x)
-> (forall x. Rep ColumnCryptoMetaData x -> ColumnCryptoMetaData)
-> Generic ColumnCryptoMetaData
forall x. Rep ColumnCryptoMetaData x -> ColumnCryptoMetaData
forall x. ColumnCryptoMetaData -> Rep ColumnCryptoMetaData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColumnCryptoMetaData -> Rep ColumnCryptoMetaData x
from :: forall x. ColumnCryptoMetaData -> Rep ColumnCryptoMetaData x
$cto :: forall x. Rep ColumnCryptoMetaData x -> ColumnCryptoMetaData
to :: forall x. Rep ColumnCryptoMetaData x -> ColumnCryptoMetaData
Generic)

instance Pinchable ColumnCryptoMetaData

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L899
data ColumnChunk
    = ColumnChunk
    { ColumnChunk -> Field 1 (Maybe Text)
cc_file_path :: Field 1 (Maybe Text)
    , ColumnChunk -> Field 2 Int64
cc_file_offset :: Field 2 Int64
    , ColumnChunk -> Field 3 (Maybe ColumnMetaData)
cc_meta_data :: Field 3 (Maybe ColumnMetaData)
    , ColumnChunk -> Field 4 (Maybe Int64)
cc_offset_index_offset :: Field 4 (Maybe Int64)
    , ColumnChunk -> Field 5 (Maybe Int32)
cc_offset_index_length :: Field 5 (Maybe Int32)
    , ColumnChunk -> Field 6 (Maybe Int64)
cc_column_index_offset :: Field 6 (Maybe Int64)
    , ColumnChunk -> Field 7 (Maybe Int32)
cc_column_index_length :: Field 7 (Maybe Int32)
    , ColumnChunk -> Field 8 (Maybe ColumnCryptoMetaData)
cc_crypto_metadata :: Field 8 (Maybe ColumnCryptoMetaData)
    , ColumnChunk -> Field 9 (Maybe ByteString)
cc_encrypted_column_metadata :: Field 9 (Maybe ByteString)
    }
    deriving (ColumnChunk -> ColumnChunk -> Bool
(ColumnChunk -> ColumnChunk -> Bool)
-> (ColumnChunk -> ColumnChunk -> Bool) -> Eq ColumnChunk
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnChunk -> ColumnChunk -> Bool
== :: ColumnChunk -> ColumnChunk -> Bool
$c/= :: ColumnChunk -> ColumnChunk -> Bool
/= :: ColumnChunk -> ColumnChunk -> Bool
Eq, Int -> ColumnChunk -> ShowS
[ColumnChunk] -> ShowS
ColumnChunk -> String
(Int -> ColumnChunk -> ShowS)
-> (ColumnChunk -> String)
-> ([ColumnChunk] -> ShowS)
-> Show ColumnChunk
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnChunk -> ShowS
showsPrec :: Int -> ColumnChunk -> ShowS
$cshow :: ColumnChunk -> String
show :: ColumnChunk -> String
$cshowList :: [ColumnChunk] -> ShowS
showList :: [ColumnChunk] -> ShowS
Show, (forall x. ColumnChunk -> Rep ColumnChunk x)
-> (forall x. Rep ColumnChunk x -> ColumnChunk)
-> Generic ColumnChunk
forall x. Rep ColumnChunk x -> ColumnChunk
forall x. ColumnChunk -> Rep ColumnChunk x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColumnChunk -> Rep ColumnChunk x
from :: forall x. ColumnChunk -> Rep ColumnChunk x
$cto :: forall x. Rep ColumnChunk x -> ColumnChunk
to :: forall x. Rep ColumnChunk x -> ColumnChunk
Generic)

instance Pinchable ColumnChunk

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L940
data SortingColumn
    = SortingColumn
    { SortingColumn -> Field 1 Int32
sc_column_idx :: Field 1 Int32
    , SortingColumn -> Field 2 Bool
sc_descending :: Field 2 Bool
    , SortingColumn -> Field 3 Bool
sc_nulls_first :: Field 3 Bool
    }
    deriving (SortingColumn -> SortingColumn -> Bool
(SortingColumn -> SortingColumn -> Bool)
-> (SortingColumn -> SortingColumn -> Bool) -> Eq SortingColumn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SortingColumn -> SortingColumn -> Bool
== :: SortingColumn -> SortingColumn -> Bool
$c/= :: SortingColumn -> SortingColumn -> Bool
/= :: SortingColumn -> SortingColumn -> Bool
Eq, Int -> SortingColumn -> ShowS
[SortingColumn] -> ShowS
SortingColumn -> String
(Int -> SortingColumn -> ShowS)
-> (SortingColumn -> String)
-> ([SortingColumn] -> ShowS)
-> Show SortingColumn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SortingColumn -> ShowS
showsPrec :: Int -> SortingColumn -> ShowS
$cshow :: SortingColumn -> String
show :: SortingColumn -> String
$cshowList :: [SortingColumn] -> ShowS
showList :: [SortingColumn] -> ShowS
Show, (forall x. SortingColumn -> Rep SortingColumn x)
-> (forall x. Rep SortingColumn x -> SortingColumn)
-> Generic SortingColumn
forall x. Rep SortingColumn x -> SortingColumn
forall x. SortingColumn -> Rep SortingColumn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SortingColumn -> Rep SortingColumn x
from :: forall x. SortingColumn -> Rep SortingColumn x
$cto :: forall x. Rep SortingColumn x -> SortingColumn
to :: forall x. Rep SortingColumn x -> SortingColumn
Generic)

instance Pinchable SortingColumn

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L958
data RowGroup
    = RowGroup
    { RowGroup -> Field 1 [ColumnChunk]
rg_columns :: Field 1 [ColumnChunk]
    , RowGroup -> Field 2 Int64
rg_total_byte_size :: Field 2 Int64
    , RowGroup -> Field 3 Int64
rg_num_rows :: Field 3 Int64
    , RowGroup -> Field 4 (Maybe [SortingColumn])
rg_sorting_columns :: Field 4 (Maybe [SortingColumn])
    , RowGroup -> Field 5 (Maybe Int64)
rg_file_offset :: Field 5 (Maybe Int64)
    , RowGroup -> Field 6 (Maybe Int64)
rg_total_compressed_size :: Field 6 (Maybe Int64)
    , RowGroup -> Field 7 (Maybe Int16)
rg_ordinal :: Field 7 (Maybe Int16)
    }
    deriving (RowGroup -> RowGroup -> Bool
(RowGroup -> RowGroup -> Bool)
-> (RowGroup -> RowGroup -> Bool) -> Eq RowGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RowGroup -> RowGroup -> Bool
== :: RowGroup -> RowGroup -> Bool
$c/= :: RowGroup -> RowGroup -> Bool
/= :: RowGroup -> RowGroup -> Bool
Eq, Int -> RowGroup -> ShowS
[RowGroup] -> ShowS
RowGroup -> String
(Int -> RowGroup -> ShowS)
-> (RowGroup -> String) -> ([RowGroup] -> ShowS) -> Show RowGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RowGroup -> ShowS
showsPrec :: Int -> RowGroup -> ShowS
$cshow :: RowGroup -> String
show :: RowGroup -> String
$cshowList :: [RowGroup] -> ShowS
showList :: [RowGroup] -> ShowS
Show, (forall x. RowGroup -> Rep RowGroup x)
-> (forall x. Rep RowGroup x -> RowGroup) -> Generic RowGroup
forall x. Rep RowGroup x -> RowGroup
forall x. RowGroup -> Rep RowGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RowGroup -> Rep RowGroup x
from :: forall x. RowGroup -> Rep RowGroup x
$cto :: forall x. Rep RowGroup x -> RowGroup
to :: forall x. Rep RowGroup x -> RowGroup
Generic)

instance Pinchable RowGroup

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L980
data KeyValue
    = KeyValue
    { KeyValue -> Field 1 Text
kv_key :: Field 1 Text
    , KeyValue -> Field 2 (Maybe Text)
kv_value :: Field 2 (Maybe Text)
    }
    deriving (KeyValue -> KeyValue -> Bool
(KeyValue -> KeyValue -> Bool)
-> (KeyValue -> KeyValue -> Bool) -> Eq KeyValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: KeyValue -> KeyValue -> Bool
== :: KeyValue -> KeyValue -> Bool
$c/= :: KeyValue -> KeyValue -> Bool
/= :: KeyValue -> KeyValue -> Bool
Eq, Int -> KeyValue -> ShowS
[KeyValue] -> ShowS
KeyValue -> String
(Int -> KeyValue -> ShowS)
-> (KeyValue -> String) -> ([KeyValue] -> ShowS) -> Show KeyValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> KeyValue -> ShowS
showsPrec :: Int -> KeyValue -> ShowS
$cshow :: KeyValue -> String
show :: KeyValue -> String
$cshowList :: [KeyValue] -> ShowS
showList :: [KeyValue] -> ShowS
Show, (forall x. KeyValue -> Rep KeyValue x)
-> (forall x. Rep KeyValue x -> KeyValue) -> Generic KeyValue
forall x. Rep KeyValue x -> KeyValue
forall x. KeyValue -> Rep KeyValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. KeyValue -> Rep KeyValue x
from :: forall x. KeyValue -> Rep KeyValue x
$cto :: forall x. Rep KeyValue x -> KeyValue
to :: forall x. Rep KeyValue x -> KeyValue
Generic)

instance Pinchable KeyValue

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L990
-- union ColumnOrder
newtype ColumnOrder
    = TYPE_ORDER (Field 1 TypeDefinedOrder)
    deriving (ColumnOrder -> ColumnOrder -> Bool
(ColumnOrder -> ColumnOrder -> Bool)
-> (ColumnOrder -> ColumnOrder -> Bool) -> Eq ColumnOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnOrder -> ColumnOrder -> Bool
== :: ColumnOrder -> ColumnOrder -> Bool
$c/= :: ColumnOrder -> ColumnOrder -> Bool
/= :: ColumnOrder -> ColumnOrder -> Bool
Eq, Int -> ColumnOrder -> ShowS
[ColumnOrder] -> ShowS
ColumnOrder -> String
(Int -> ColumnOrder -> ShowS)
-> (ColumnOrder -> String)
-> ([ColumnOrder] -> ShowS)
-> Show ColumnOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnOrder -> ShowS
showsPrec :: Int -> ColumnOrder -> ShowS
$cshow :: ColumnOrder -> String
show :: ColumnOrder -> String
$cshowList :: [ColumnOrder] -> ShowS
showList :: [ColumnOrder] -> ShowS
Show, (forall x. ColumnOrder -> Rep ColumnOrder x)
-> (forall x. Rep ColumnOrder x -> ColumnOrder)
-> Generic ColumnOrder
forall x. Rep ColumnOrder x -> ColumnOrder
forall x. ColumnOrder -> Rep ColumnOrder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColumnOrder -> Rep ColumnOrder x
from :: forall x. ColumnOrder -> Rep ColumnOrder x
$cto :: forall x. Rep ColumnOrder x -> ColumnOrder
to :: forall x. Rep ColumnOrder x -> ColumnOrder
Generic)

instance Pinchable ColumnOrder

-- Empty struct for TYPE_ORDER
data TypeDefinedOrder = TypeDefinedOrder deriving (TypeDefinedOrder -> TypeDefinedOrder -> Bool
(TypeDefinedOrder -> TypeDefinedOrder -> Bool)
-> (TypeDefinedOrder -> TypeDefinedOrder -> Bool)
-> Eq TypeDefinedOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TypeDefinedOrder -> TypeDefinedOrder -> Bool
== :: TypeDefinedOrder -> TypeDefinedOrder -> Bool
$c/= :: TypeDefinedOrder -> TypeDefinedOrder -> Bool
/= :: TypeDefinedOrder -> TypeDefinedOrder -> Bool
Eq, Int -> TypeDefinedOrder -> ShowS
[TypeDefinedOrder] -> ShowS
TypeDefinedOrder -> String
(Int -> TypeDefinedOrder -> ShowS)
-> (TypeDefinedOrder -> String)
-> ([TypeDefinedOrder] -> ShowS)
-> Show TypeDefinedOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TypeDefinedOrder -> ShowS
showsPrec :: Int -> TypeDefinedOrder -> ShowS
$cshow :: TypeDefinedOrder -> String
show :: TypeDefinedOrder -> String
$cshowList :: [TypeDefinedOrder] -> ShowS
showList :: [TypeDefinedOrder] -> ShowS
Show)
instance Pinchable TypeDefinedOrder where
    type Tag TypeDefinedOrder = Pinch.TStruct
    pinch :: TypeDefinedOrder -> Value (Tag TypeDefinedOrder)
pinch TypeDefinedOrder
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag TypeDefinedOrder) -> Parser TypeDefinedOrder
unpinch Value (Tag TypeDefinedOrder)
_ = TypeDefinedOrder -> Parser TypeDefinedOrder
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure TypeDefinedOrder
TypeDefinedOrder

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1094
data AesGcmV1
    = AesGcmV1
    { AesGcmV1 -> Field 1 (Maybe ByteString)
aes_gcm_v1_aad_prefix :: Field 1 (Maybe ByteString)
    , AesGcmV1 -> Field 2 (Maybe ByteString)
aes_gcm_v1_aad_file_unique :: Field 2 (Maybe ByteString)
    , AesGcmV1 -> Field 3 (Maybe Bool)
aes_gcm_v1_supply_aad_prefix :: Field 3 (Maybe Bool)
    }
    deriving (AesGcmV1 -> AesGcmV1 -> Bool
(AesGcmV1 -> AesGcmV1 -> Bool)
-> (AesGcmV1 -> AesGcmV1 -> Bool) -> Eq AesGcmV1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AesGcmV1 -> AesGcmV1 -> Bool
== :: AesGcmV1 -> AesGcmV1 -> Bool
$c/= :: AesGcmV1 -> AesGcmV1 -> Bool
/= :: AesGcmV1 -> AesGcmV1 -> Bool
Eq, Int -> AesGcmV1 -> ShowS
[AesGcmV1] -> ShowS
AesGcmV1 -> String
(Int -> AesGcmV1 -> ShowS)
-> (AesGcmV1 -> String) -> ([AesGcmV1] -> ShowS) -> Show AesGcmV1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AesGcmV1 -> ShowS
showsPrec :: Int -> AesGcmV1 -> ShowS
$cshow :: AesGcmV1 -> String
show :: AesGcmV1 -> String
$cshowList :: [AesGcmV1] -> ShowS
showList :: [AesGcmV1] -> ShowS
Show, (forall x. AesGcmV1 -> Rep AesGcmV1 x)
-> (forall x. Rep AesGcmV1 x -> AesGcmV1) -> Generic AesGcmV1
forall x. Rep AesGcmV1 x -> AesGcmV1
forall x. AesGcmV1 -> Rep AesGcmV1 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AesGcmV1 -> Rep AesGcmV1 x
from :: forall x. AesGcmV1 -> Rep AesGcmV1 x
$cto :: forall x. Rep AesGcmV1 x -> AesGcmV1
to :: forall x. Rep AesGcmV1 x -> AesGcmV1
Generic)

instance Pinchable AesGcmV1

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1107
data AesGcmCtrV1
    = AesGcmCtrV1
    { AesGcmCtrV1 -> Field 1 (Maybe ByteString)
aes_gcm_ctr_v1_aad_prefix :: Field 1 (Maybe ByteString)
    , AesGcmCtrV1 -> Field 2 (Maybe ByteString)
aes_gcm_ctr_v1_aad_file_unique :: Field 2 (Maybe ByteString)
    , AesGcmCtrV1 -> Field 3 (Maybe Bool)
aes_gcm_ctr_v1_supply_aad_prefix :: Field 3 (Maybe Bool)
    }
    deriving (AesGcmCtrV1 -> AesGcmCtrV1 -> Bool
(AesGcmCtrV1 -> AesGcmCtrV1 -> Bool)
-> (AesGcmCtrV1 -> AesGcmCtrV1 -> Bool) -> Eq AesGcmCtrV1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AesGcmCtrV1 -> AesGcmCtrV1 -> Bool
== :: AesGcmCtrV1 -> AesGcmCtrV1 -> Bool
$c/= :: AesGcmCtrV1 -> AesGcmCtrV1 -> Bool
/= :: AesGcmCtrV1 -> AesGcmCtrV1 -> Bool
Eq, Int -> AesGcmCtrV1 -> ShowS
[AesGcmCtrV1] -> ShowS
AesGcmCtrV1 -> String
(Int -> AesGcmCtrV1 -> ShowS)
-> (AesGcmCtrV1 -> String)
-> ([AesGcmCtrV1] -> ShowS)
-> Show AesGcmCtrV1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AesGcmCtrV1 -> ShowS
showsPrec :: Int -> AesGcmCtrV1 -> ShowS
$cshow :: AesGcmCtrV1 -> String
show :: AesGcmCtrV1 -> String
$cshowList :: [AesGcmCtrV1] -> ShowS
showList :: [AesGcmCtrV1] -> ShowS
Show, (forall x. AesGcmCtrV1 -> Rep AesGcmCtrV1 x)
-> (forall x. Rep AesGcmCtrV1 x -> AesGcmCtrV1)
-> Generic AesGcmCtrV1
forall x. Rep AesGcmCtrV1 x -> AesGcmCtrV1
forall x. AesGcmCtrV1 -> Rep AesGcmCtrV1 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AesGcmCtrV1 -> Rep AesGcmCtrV1 x
from :: forall x. AesGcmCtrV1 -> Rep AesGcmCtrV1 x
$cto :: forall x. Rep AesGcmCtrV1 x -> AesGcmCtrV1
to :: forall x. Rep AesGcmCtrV1 x -> AesGcmCtrV1
Generic)

instance Pinchable AesGcmCtrV1

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1118
-- union EncryptionAlgorithm
data EncryptionAlgorithm
    = AES_GCM_V1 (Field 1 AesGcmV1)
    | AES_GCM_CTR_V1 (Field 2 AesGcmCtrV1)
    deriving (EncryptionAlgorithm -> EncryptionAlgorithm -> Bool
(EncryptionAlgorithm -> EncryptionAlgorithm -> Bool)
-> (EncryptionAlgorithm -> EncryptionAlgorithm -> Bool)
-> Eq EncryptionAlgorithm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EncryptionAlgorithm -> EncryptionAlgorithm -> Bool
== :: EncryptionAlgorithm -> EncryptionAlgorithm -> Bool
$c/= :: EncryptionAlgorithm -> EncryptionAlgorithm -> Bool
/= :: EncryptionAlgorithm -> EncryptionAlgorithm -> Bool
Eq, Int -> EncryptionAlgorithm -> ShowS
[EncryptionAlgorithm] -> ShowS
EncryptionAlgorithm -> String
(Int -> EncryptionAlgorithm -> ShowS)
-> (EncryptionAlgorithm -> String)
-> ([EncryptionAlgorithm] -> ShowS)
-> Show EncryptionAlgorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EncryptionAlgorithm -> ShowS
showsPrec :: Int -> EncryptionAlgorithm -> ShowS
$cshow :: EncryptionAlgorithm -> String
show :: EncryptionAlgorithm -> String
$cshowList :: [EncryptionAlgorithm] -> ShowS
showList :: [EncryptionAlgorithm] -> ShowS
Show, (forall x. EncryptionAlgorithm -> Rep EncryptionAlgorithm x)
-> (forall x. Rep EncryptionAlgorithm x -> EncryptionAlgorithm)
-> Generic EncryptionAlgorithm
forall x. Rep EncryptionAlgorithm x -> EncryptionAlgorithm
forall x. EncryptionAlgorithm -> Rep EncryptionAlgorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EncryptionAlgorithm -> Rep EncryptionAlgorithm x
from :: forall x. EncryptionAlgorithm -> Rep EncryptionAlgorithm x
$cto :: forall x. Rep EncryptionAlgorithm x -> EncryptionAlgorithm
to :: forall x. Rep EncryptionAlgorithm x -> EncryptionAlgorithm
Generic)

instance Pinchable EncryptionAlgorithm

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1001
data PageLocation
    = PageLocation
    { PageLocation -> Field 1 Int64
pl_offset :: Field 1 Int64
    , PageLocation -> Field 2 Int32
pl_compressed_page_size :: Field 2 Int32
    , PageLocation -> Field 3 Int64
pl_first_row_index :: Field 3 Int64
    }
    deriving (PageLocation -> PageLocation -> Bool
(PageLocation -> PageLocation -> Bool)
-> (PageLocation -> PageLocation -> Bool) -> Eq PageLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageLocation -> PageLocation -> Bool
== :: PageLocation -> PageLocation -> Bool
$c/= :: PageLocation -> PageLocation -> Bool
/= :: PageLocation -> PageLocation -> Bool
Eq, Int -> PageLocation -> ShowS
[PageLocation] -> ShowS
PageLocation -> String
(Int -> PageLocation -> ShowS)
-> (PageLocation -> String)
-> ([PageLocation] -> ShowS)
-> Show PageLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageLocation -> ShowS
showsPrec :: Int -> PageLocation -> ShowS
$cshow :: PageLocation -> String
show :: PageLocation -> String
$cshowList :: [PageLocation] -> ShowS
showList :: [PageLocation] -> ShowS
Show, (forall x. PageLocation -> Rep PageLocation x)
-> (forall x. Rep PageLocation x -> PageLocation)
-> Generic PageLocation
forall x. Rep PageLocation x -> PageLocation
forall x. PageLocation -> Rep PageLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PageLocation -> Rep PageLocation x
from :: forall x. PageLocation -> Rep PageLocation x
$cto :: forall x. Rep PageLocation x -> PageLocation
to :: forall x. Rep PageLocation x -> PageLocation
Generic)

instance Pinchable PageLocation

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1017
data OffsetIndex
    = OffsetIndex
    { OffsetIndex -> Field 1 [PageLocation]
oi_page_locations :: Field 1 [PageLocation]
    , OffsetIndex -> Field 2 (Maybe [Int64])
oi_unencoded_byte_array_data_bytes :: Field 2 (Maybe [Int64])
    }
    deriving (OffsetIndex -> OffsetIndex -> Bool
(OffsetIndex -> OffsetIndex -> Bool)
-> (OffsetIndex -> OffsetIndex -> Bool) -> Eq OffsetIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OffsetIndex -> OffsetIndex -> Bool
== :: OffsetIndex -> OffsetIndex -> Bool
$c/= :: OffsetIndex -> OffsetIndex -> Bool
/= :: OffsetIndex -> OffsetIndex -> Bool
Eq, Int -> OffsetIndex -> ShowS
[OffsetIndex] -> ShowS
OffsetIndex -> String
(Int -> OffsetIndex -> ShowS)
-> (OffsetIndex -> String)
-> ([OffsetIndex] -> ShowS)
-> Show OffsetIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OffsetIndex -> ShowS
showsPrec :: Int -> OffsetIndex -> ShowS
$cshow :: OffsetIndex -> String
show :: OffsetIndex -> String
$cshowList :: [OffsetIndex] -> ShowS
showList :: [OffsetIndex] -> ShowS
Show, (forall x. OffsetIndex -> Rep OffsetIndex x)
-> (forall x. Rep OffsetIndex x -> OffsetIndex)
-> Generic OffsetIndex
forall x. Rep OffsetIndex x -> OffsetIndex
forall x. OffsetIndex -> Rep OffsetIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. OffsetIndex -> Rep OffsetIndex x
from :: forall x. OffsetIndex -> Rep OffsetIndex x
$cto :: forall x. Rep OffsetIndex x -> OffsetIndex
to :: forall x. Rep OffsetIndex x -> OffsetIndex
Generic)

instance Pinchable OffsetIndex

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1033
data ColumnIndex
    = ColumnIndex
    { ColumnIndex -> Field 1 [Bool]
ci_null_pages :: Field 1 [Bool]
    , ColumnIndex -> Field 2 [ByteString]
ci_min_values :: Field 2 [ByteString]
    , ColumnIndex -> Field 3 [ByteString]
ci_max_values :: Field 3 [ByteString]
    , ColumnIndex -> Field 4 BoundaryOrder
ci_boundary_order :: Field 4 BoundaryOrder
    , ColumnIndex -> Field 5 (Maybe [Int64])
ci_null_counts :: Field 5 (Maybe [Int64])
    , ColumnIndex -> Field 6 (Maybe [Int64])
ci_repetition_level_histograms :: Field 6 (Maybe [Int64])
    , ColumnIndex -> Field 7 (Maybe [Int64])
ci_definition_level_histograms :: Field 7 (Maybe [Int64])
    }
    deriving (ColumnIndex -> ColumnIndex -> Bool
(ColumnIndex -> ColumnIndex -> Bool)
-> (ColumnIndex -> ColumnIndex -> Bool) -> Eq ColumnIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnIndex -> ColumnIndex -> Bool
== :: ColumnIndex -> ColumnIndex -> Bool
$c/= :: ColumnIndex -> ColumnIndex -> Bool
/= :: ColumnIndex -> ColumnIndex -> Bool
Eq, Int -> ColumnIndex -> ShowS
[ColumnIndex] -> ShowS
ColumnIndex -> String
(Int -> ColumnIndex -> ShowS)
-> (ColumnIndex -> String)
-> ([ColumnIndex] -> ShowS)
-> Show ColumnIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnIndex -> ShowS
showsPrec :: Int -> ColumnIndex -> ShowS
$cshow :: ColumnIndex -> String
show :: ColumnIndex -> String
$cshowList :: [ColumnIndex] -> ShowS
showList :: [ColumnIndex] -> ShowS
Show, (forall x. ColumnIndex -> Rep ColumnIndex x)
-> (forall x. Rep ColumnIndex x -> ColumnIndex)
-> Generic ColumnIndex
forall x. Rep ColumnIndex x -> ColumnIndex
forall x. ColumnIndex -> Rep ColumnIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColumnIndex -> Rep ColumnIndex x
from :: forall x. ColumnIndex -> Rep ColumnIndex x
$cto :: forall x. Rep ColumnIndex x -> ColumnIndex
to :: forall x. Rep ColumnIndex x -> ColumnIndex
Generic)

instance Pinchable ColumnIndex

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1248
data DataPageHeader
    = DataPageHeader
    { DataPageHeader -> Field 1 Int32
dph_num_values :: Field 1 Int32
    , DataPageHeader -> Field 2 Encoding
dph_encoding :: Field 2 Encoding
    , DataPageHeader -> Field 3 Encoding
dph_definition_level_encoding :: Field 3 Encoding
    , DataPageHeader -> Field 4 Encoding
dph_repetition_level_encoding :: Field 4 Encoding
    , DataPageHeader -> Field 5 (Maybe Statistics)
dph_statistics :: Field 5 (Maybe Statistics)
    }
    deriving (DataPageHeader -> DataPageHeader -> Bool
(DataPageHeader -> DataPageHeader -> Bool)
-> (DataPageHeader -> DataPageHeader -> Bool) -> Eq DataPageHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DataPageHeader -> DataPageHeader -> Bool
== :: DataPageHeader -> DataPageHeader -> Bool
$c/= :: DataPageHeader -> DataPageHeader -> Bool
/= :: DataPageHeader -> DataPageHeader -> Bool
Eq, Int -> DataPageHeader -> ShowS
[DataPageHeader] -> ShowS
DataPageHeader -> String
(Int -> DataPageHeader -> ShowS)
-> (DataPageHeader -> String)
-> ([DataPageHeader] -> ShowS)
-> Show DataPageHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DataPageHeader -> ShowS
showsPrec :: Int -> DataPageHeader -> ShowS
$cshow :: DataPageHeader -> String
show :: DataPageHeader -> String
$cshowList :: [DataPageHeader] -> ShowS
showList :: [DataPageHeader] -> ShowS
Show, (forall x. DataPageHeader -> Rep DataPageHeader x)
-> (forall x. Rep DataPageHeader x -> DataPageHeader)
-> Generic DataPageHeader
forall x. Rep DataPageHeader x -> DataPageHeader
forall x. DataPageHeader -> Rep DataPageHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DataPageHeader -> Rep DataPageHeader x
from :: forall x. DataPageHeader -> Rep DataPageHeader x
$cto :: forall x. Rep DataPageHeader x -> DataPageHeader
to :: forall x. Rep DataPageHeader x -> DataPageHeader
Generic)

instance Pinchable DataPageHeader

data IndexPageHeader = IndexPageHeader deriving (IndexPageHeader -> IndexPageHeader -> Bool
(IndexPageHeader -> IndexPageHeader -> Bool)
-> (IndexPageHeader -> IndexPageHeader -> Bool)
-> Eq IndexPageHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IndexPageHeader -> IndexPageHeader -> Bool
== :: IndexPageHeader -> IndexPageHeader -> Bool
$c/= :: IndexPageHeader -> IndexPageHeader -> Bool
/= :: IndexPageHeader -> IndexPageHeader -> Bool
Eq, Int -> IndexPageHeader -> ShowS
[IndexPageHeader] -> ShowS
IndexPageHeader -> String
(Int -> IndexPageHeader -> ShowS)
-> (IndexPageHeader -> String)
-> ([IndexPageHeader] -> ShowS)
-> Show IndexPageHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IndexPageHeader -> ShowS
showsPrec :: Int -> IndexPageHeader -> ShowS
$cshow :: IndexPageHeader -> String
show :: IndexPageHeader -> String
$cshowList :: [IndexPageHeader] -> ShowS
showList :: [IndexPageHeader] -> ShowS
Show)
instance Pinchable IndexPageHeader where
    type Tag IndexPageHeader = Pinch.TStruct
    pinch :: IndexPageHeader -> Value (Tag IndexPageHeader)
pinch IndexPageHeader
_ = [FieldPair] -> Value TStruct
Pinch.struct []
    unpinch :: Value (Tag IndexPageHeader) -> Parser IndexPageHeader
unpinch Value (Tag IndexPageHeader)
_ = IndexPageHeader -> Parser IndexPageHeader
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure IndexPageHeader
IndexPageHeader

data DictionaryPageHeader
    = DictionaryPageHeader
    { DictionaryPageHeader -> Field 1 Int32
diph_num_values :: Field 1 Int32
    , DictionaryPageHeader -> Field 2 Encoding
diph_encoding :: Field 2 Encoding
    , DictionaryPageHeader -> Field 3 (Maybe Bool)
diph_is_sorted :: Field 3 (Maybe Bool)
    }
    deriving (DictionaryPageHeader -> DictionaryPageHeader -> Bool
(DictionaryPageHeader -> DictionaryPageHeader -> Bool)
-> (DictionaryPageHeader -> DictionaryPageHeader -> Bool)
-> Eq DictionaryPageHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DictionaryPageHeader -> DictionaryPageHeader -> Bool
== :: DictionaryPageHeader -> DictionaryPageHeader -> Bool
$c/= :: DictionaryPageHeader -> DictionaryPageHeader -> Bool
/= :: DictionaryPageHeader -> DictionaryPageHeader -> Bool
Eq, Int -> DictionaryPageHeader -> ShowS
[DictionaryPageHeader] -> ShowS
DictionaryPageHeader -> String
(Int -> DictionaryPageHeader -> ShowS)
-> (DictionaryPageHeader -> String)
-> ([DictionaryPageHeader] -> ShowS)
-> Show DictionaryPageHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DictionaryPageHeader -> ShowS
showsPrec :: Int -> DictionaryPageHeader -> ShowS
$cshow :: DictionaryPageHeader -> String
show :: DictionaryPageHeader -> String
$cshowList :: [DictionaryPageHeader] -> ShowS
showList :: [DictionaryPageHeader] -> ShowS
Show, (forall x. DictionaryPageHeader -> Rep DictionaryPageHeader x)
-> (forall x. Rep DictionaryPageHeader x -> DictionaryPageHeader)
-> Generic DictionaryPageHeader
forall x. Rep DictionaryPageHeader x -> DictionaryPageHeader
forall x. DictionaryPageHeader -> Rep DictionaryPageHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DictionaryPageHeader -> Rep DictionaryPageHeader x
from :: forall x. DictionaryPageHeader -> Rep DictionaryPageHeader x
$cto :: forall x. Rep DictionaryPageHeader x -> DictionaryPageHeader
to :: forall x. Rep DictionaryPageHeader x -> DictionaryPageHeader
Generic)

instance Pinchable DictionaryPageHeader

data DataPageHeaderV2
    = DataPageHeaderV2
    { DataPageHeaderV2 -> Field 1 Int32
dph2_num_values :: Field 1 Int32
    , DataPageHeaderV2 -> Field 2 Int32
dph2_num_nulls :: Field 2 Int32
    , DataPageHeaderV2 -> Field 3 Int32
dph2_num_rows :: Field 3 Int32
    , DataPageHeaderV2 -> Field 4 Encoding
dph2_encoding :: Field 4 Encoding
    , DataPageHeaderV2 -> Field 5 Int32
dph2_definition_levels_byte_length :: Field 5 Int32
    , DataPageHeaderV2 -> Field 6 Int32
dph2_repetition_levels_byte_length :: Field 6 Int32
    , DataPageHeaderV2 -> Field 7 (Maybe Bool)
dph2_is_compressed :: Field 7 (Maybe Bool)
    , DataPageHeaderV2 -> Field 8 (Maybe Statistics)
dph2_statistics :: Field 8 (Maybe Statistics)
    }
    deriving (DataPageHeaderV2 -> DataPageHeaderV2 -> Bool
(DataPageHeaderV2 -> DataPageHeaderV2 -> Bool)
-> (DataPageHeaderV2 -> DataPageHeaderV2 -> Bool)
-> Eq DataPageHeaderV2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DataPageHeaderV2 -> DataPageHeaderV2 -> Bool
== :: DataPageHeaderV2 -> DataPageHeaderV2 -> Bool
$c/= :: DataPageHeaderV2 -> DataPageHeaderV2 -> Bool
/= :: DataPageHeaderV2 -> DataPageHeaderV2 -> Bool
Eq, Int -> DataPageHeaderV2 -> ShowS
[DataPageHeaderV2] -> ShowS
DataPageHeaderV2 -> String
(Int -> DataPageHeaderV2 -> ShowS)
-> (DataPageHeaderV2 -> String)
-> ([DataPageHeaderV2] -> ShowS)
-> Show DataPageHeaderV2
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DataPageHeaderV2 -> ShowS
showsPrec :: Int -> DataPageHeaderV2 -> ShowS
$cshow :: DataPageHeaderV2 -> String
show :: DataPageHeaderV2 -> String
$cshowList :: [DataPageHeaderV2] -> ShowS
showList :: [DataPageHeaderV2] -> ShowS
Show, (forall x. DataPageHeaderV2 -> Rep DataPageHeaderV2 x)
-> (forall x. Rep DataPageHeaderV2 x -> DataPageHeaderV2)
-> Generic DataPageHeaderV2
forall x. Rep DataPageHeaderV2 x -> DataPageHeaderV2
forall x. DataPageHeaderV2 -> Rep DataPageHeaderV2 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DataPageHeaderV2 -> Rep DataPageHeaderV2 x
from :: forall x. DataPageHeaderV2 -> Rep DataPageHeaderV2 x
$cto :: forall x. Rep DataPageHeaderV2 x -> DataPageHeaderV2
to :: forall x. Rep DataPageHeaderV2 x -> DataPageHeaderV2
Generic)

instance Pinchable DataPageHeaderV2

data PageHeader
    = PageHeader
    { PageHeader -> Field 1 PageType
ph_type :: Field 1 PageType
    , PageHeader -> Field 2 Int32
ph_uncompressed_page_size :: Field 2 Int32
    , PageHeader -> Field 3 Int32
ph_compressed_page_size :: Field 3 Int32
    , PageHeader -> Field 4 (Maybe Int32)
ph_crc :: Field 4 (Maybe Int32)
    , PageHeader -> Field 5 (Maybe DataPageHeader)
ph_data_page_header :: Field 5 (Maybe DataPageHeader)
    , PageHeader -> Field 6 (Maybe IndexPageHeader)
ph_index_page_header :: Field 6 (Maybe IndexPageHeader)
    , PageHeader -> Field 7 (Maybe DictionaryPageHeader)
ph_dictionary_page_header :: Field 7 (Maybe DictionaryPageHeader)
    , PageHeader -> Field 8 (Maybe DataPageHeaderV2)
ph_data_page_header_v2 :: Field 8 (Maybe DataPageHeaderV2)
    }
    deriving (PageHeader -> PageHeader -> Bool
(PageHeader -> PageHeader -> Bool)
-> (PageHeader -> PageHeader -> Bool) -> Eq PageHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageHeader -> PageHeader -> Bool
== :: PageHeader -> PageHeader -> Bool
$c/= :: PageHeader -> PageHeader -> Bool
/= :: PageHeader -> PageHeader -> Bool
Eq, Int -> PageHeader -> ShowS
[PageHeader] -> ShowS
PageHeader -> String
(Int -> PageHeader -> ShowS)
-> (PageHeader -> String)
-> ([PageHeader] -> ShowS)
-> Show PageHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageHeader -> ShowS
showsPrec :: Int -> PageHeader -> ShowS
$cshow :: PageHeader -> String
show :: PageHeader -> String
$cshowList :: [PageHeader] -> ShowS
showList :: [PageHeader] -> ShowS
Show, (forall x. PageHeader -> Rep PageHeader x)
-> (forall x. Rep PageHeader x -> PageHeader) -> Generic PageHeader
forall x. Rep PageHeader x -> PageHeader
forall x. PageHeader -> Rep PageHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PageHeader -> Rep PageHeader x
from :: forall x. PageHeader -> Rep PageHeader x
$cto :: forall x. Rep PageHeader x -> PageHeader
to :: forall x. Rep PageHeader x -> PageHeader
Generic)

instance Pinchable PageHeader

-- https://github.com/apache/parquet-format/blob/master/src/main/thrift/parquet.thrift#L1277
data FileMetadata
    = FileMetadata
    { FileMetadata -> Field 1 Int32
version :: Field 1 Int32
    , FileMetadata -> Field 2 [SchemaElement]
schema :: Field 2 [SchemaElement]
    , FileMetadata -> Field 3 Int64
num_rows :: Field 3 Int64
    , FileMetadata -> Field 4 [RowGroup]
row_groups :: Field 4 [RowGroup]
    , FileMetadata -> Field 5 (Maybe [KeyValue])
key_value_metadata :: Field 5 (Maybe [KeyValue])
    , FileMetadata -> Field 6 (Maybe Text)
created_by :: Field 6 (Maybe Text)
    , FileMetadata -> Field 7 (Maybe [ColumnOrder])
column_orders :: Field 7 (Maybe [ColumnOrder])
    , FileMetadata -> Field 8 (Maybe EncryptionAlgorithm)
encryption_algorithm :: Field 8 (Maybe EncryptionAlgorithm)
    , FileMetadata -> Field 9 (Maybe ByteString)
footer_signing_key_metadata :: Field 9 (Maybe ByteString)
    }
    deriving (FileMetadata -> FileMetadata -> Bool
(FileMetadata -> FileMetadata -> Bool)
-> (FileMetadata -> FileMetadata -> Bool) -> Eq FileMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FileMetadata -> FileMetadata -> Bool
== :: FileMetadata -> FileMetadata -> Bool
$c/= :: FileMetadata -> FileMetadata -> Bool
/= :: FileMetadata -> FileMetadata -> Bool
Eq, Int -> FileMetadata -> ShowS
[FileMetadata] -> ShowS
FileMetadata -> String
(Int -> FileMetadata -> ShowS)
-> (FileMetadata -> String)
-> ([FileMetadata] -> ShowS)
-> Show FileMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FileMetadata -> ShowS
showsPrec :: Int -> FileMetadata -> ShowS
$cshow :: FileMetadata -> String
show :: FileMetadata -> String
$cshowList :: [FileMetadata] -> ShowS
showList :: [FileMetadata] -> ShowS
Show, (forall x. FileMetadata -> Rep FileMetadata x)
-> (forall x. Rep FileMetadata x -> FileMetadata)
-> Generic FileMetadata
forall x. Rep FileMetadata x -> FileMetadata
forall x. FileMetadata -> Rep FileMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FileMetadata -> Rep FileMetadata x
from :: forall x. FileMetadata -> Rep FileMetadata x
$cto :: forall x. Rep FileMetadata x -> FileMetadata
to :: forall x. Rep FileMetadata x -> FileMetadata
Generic)

instance Pinchable FileMetadata

unField :: (KnownNat n) => Field n a -> a
unField :: forall (n :: Nat) a. KnownNat n => Field n a -> a
unField (Pinch.Field a
a) = a
a