metadata

package
v0.0.0-...-1e7f4ca Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRUE  = 0x01
	FALSE = 0x00
)

Variables

View Source
var (
	BINARY_VALUE_BYTES_OVERHEAD int64 = util.BYTE_BYTES + util.INT32_BYTES
	BINARY_STAT_INSTANCE_SIZE   int32 = util.SizeOf(&BinaryStatistics{})
)
View Source
var (
	BLOOM_FILTER_INSTANCE_SIZE int32 = util.SizeOf(&BloomFilter{})
	BLOOM_FILTER_NULL_HASHCODE int64 = int64(2862933555777941757)
)
View Source
var (
	C1           uint64 = 0x87c37b91114253d5
	C2           int64  = 0x4cf5ad432745937f
	R1           int32  = 31
	R2           int32  = 27
	M            int32  = 5
	N1           int32  = 0x52dce729
	DEFAULT_SEED int32  = 104729
)
View Source
var (
	BOOLEAN_VALUE_BYTES   int64 = 1 + 1
	BOOLEAN_INSTANCE_SIZE int32 = util.SizeOf(&BooleanStatistics{})
)

var (

BooleanStatisticsBOOLEAN_VALUE_BYTES int64 = Byte.BYTES + Byte.BYTES
booleanStatisticsiNSTANCE_SIZE       int32 = ClassLayout.parseClass(BooleanStatistics.class).instanceSize()

)

View Source
var (
	DATE_VALUE_BYTES              int64 = util.BYTE_BYTES + util.INT32_BYTES
	DATE_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&DateStatistics{})
)
View Source
var (
	DECIMAL_VALUE_BYTES_OVERHEAD         int64 = util.BYTE_BYTES
	DECIMAL_STATISTICS_INSTANCE_SIZE     int32 = util.SizeOf(&DecimalStatistics{})
	STATISTICS_BIG_DECIMAL_INSTANCE_SIZE int64 = int64(util.SizeOf(&decimal.Decimal{})) + int64(util.SizeOf(&block.BigInt{})) + util.SizeOfInt64(make([]int32, 0))
)
View Source
var (
	DOUBLE_VALUE_BYTES              int64 = util.BYTE_BYTES + util.FLOAT64_BYTES
	DOUBLE_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&DoubleStatistics{})
)
View Source
var (
	INTEGER_VALUE_BYTES              int64 = util.BYTE_BYTES + util.INT64_BYTES
	INTEGER_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&IntegerStatistics{})
)
View Source
var (
	REPLACEMENT_CHARACTER_CODE_POINT int32 = 0xFFFD
	PROTOBUF_MESSAGE_MAX_LIMIT       int32 = util.Int32Exact(int64(util.GB.Bytes()))
)
View Source
var (
	MOTH_WRITER_ID             uint32   = 4
	MOTH_WRITER_VERSION        int32    = 6
	PRESTO_WRITER_ID           int32    = 2
	HIVE_LEGACY_WRITER_VERSION int32    = 4
	MOTH_METADATA_VERSION      []uint32 = []uint32{0, 12}
)
View Source
var (
	STRING_VALUE_BYTES_OVERHEAD     int64 = util.BYTE_BYTES + util.INT32_BYTES
	STRING_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&StringStatistics{})
)
View Source
var (
	TIMESTAMP_VALUE_BYTES    int64 = util.BYTE_BYTES + util.INT64_BYTES
	STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&TimestampStatistics{})
)
View Source
var COLUMN_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&ColumnStatistics{})
View Source
var LONG_DECIMAL_LONG_DECIMAL_VALUE_BYTES int64 = 16
View Source
var MAGIC string = "MOTH"
View Source
var MAGIC_SLICE = slice.NewWithString("MOTH")
View Source
var SHORT_DECIMAL_VALUE_BYTES int64 = 8
View Source
var STRIPE_STATISTICS_INSTANCE_SIZE int32 = util.SizeOf(&StripeStatistics{})

Functions

func Hash64

func Hash64(data []byte) int64

@SuppressWarnings("fallthrough")

func Hash64_2

func Hash64_2(data *slice.Slice) int64

@SuppressWarnings("fallthrough")

func PutBool

func PutBool(val bool, b []byte, i int)

Types

type BinaryStatistics

type BinaryStatistics struct {
	//继承
	Hashable
	// contains filtered or unexported fields
}

func NewBinaryStatistics

func NewBinaryStatistics(sum int64) *BinaryStatistics

func (*BinaryStatistics) AddHash

func (bs *BinaryStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*BinaryStatistics) GetRetainedSizeInBytes

func (bs *BinaryStatistics) GetRetainedSizeInBytes() int64

func (*BinaryStatistics) GetSum

func (bs *BinaryStatistics) GetSum() int64

func (*BinaryStatistics) GetSumPtr

func (bs *BinaryStatistics) GetSumPtr() *int64

func (*BinaryStatistics) ToString

func (bs *BinaryStatistics) ToString() string

@Override

type BinaryStatisticsBuilder

type BinaryStatisticsBuilder struct {
	// 继承
	SliceColumnStatisticsBuilder
	// contains filtered or unexported fields
}

func NewBinaryStatisticsBuilder

func NewBinaryStatisticsBuilder() *BinaryStatisticsBuilder

func (*BinaryStatisticsBuilder) AddValue

func (br *BinaryStatisticsBuilder) AddValue(value *slice.Slice)

@Override

func (*BinaryStatisticsBuilder) BuildColumnStatistics

func (br *BinaryStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type BitSet

type BitSet struct {
	// contains filtered or unexported fields
}

func NewBitSet

func NewBitSet(bits int64) *BitSet

func NewBitSet2

func NewBitSet2(data []int64) *BitSet

func (*BitSet) BitSize

func (bt *BitSet) BitSize() int64

func (*BitSet) Get

func (bt *BitSet) Get(index int32) bool

func (*BitSet) GetData

func (bt *BitSet) GetData() []int64

func (*BitSet) Set

func (bt *BitSet) Set(index int32)

type BloomFilter

type BloomFilter struct {
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewBloomFilter

func NewBloomFilter(expectedEntries int64, fpp float64) *BloomFilter

func NewBloomFilter2

func NewBloomFilter2(bits []int64, numFuncs int32) *BloomFilter

func (*BloomFilter) Add

func (br *BloomFilter) Add(val []byte)

func (*BloomFilter) Add2

func (br *BloomFilter) Add2(val *slice.Slice)

func (*BloomFilter) AddDouble

func (br *BloomFilter) AddDouble(val float64)

func (*BloomFilter) AddFloat

func (br *BloomFilter) AddFloat(val float32)

func (*BloomFilter) AddHash

func (br *BloomFilter) AddHash(hasher *StatisticsHasher)

@Override

func (*BloomFilter) AddHash2

func (br *BloomFilter) AddHash2(hash64 int64)

func (*BloomFilter) AddLong

func (br *BloomFilter) AddLong(val int64)

func (*BloomFilter) GetBitSet

func (br *BloomFilter) GetBitSet() []int64

func (*BloomFilter) GetNumBits

func (br *BloomFilter) GetNumBits() int32

func (*BloomFilter) GetNumHashFunctions

func (br *BloomFilter) GetNumHashFunctions() int32

func (*BloomFilter) GetNumHashFunctionsPtr

func (br *BloomFilter) GetNumHashFunctionsPtr() *uint32

func (*BloomFilter) GetRetainedSizeInBytes

func (br *BloomFilter) GetRetainedSizeInBytes() int64

func (*BloomFilter) Test

func (br *BloomFilter) Test(val []byte) bool

func (*BloomFilter) TestDouble

func (br *BloomFilter) TestDouble(val float64) bool

func (*BloomFilter) TestFloat

func (br *BloomFilter) TestFloat(val float32) bool

func (*BloomFilter) TestLong

func (br *BloomFilter) TestLong(val int64) bool

func (*BloomFilter) TestSlice

func (br *BloomFilter) TestSlice(val *slice.Slice) bool

type BloomFilterBuilder

type BloomFilterBuilder interface {
	AddString(val *slice.Slice) BloomFilterBuilder

	AddLong(val int64) BloomFilterBuilder

	AddDouble(val float64) BloomFilterBuilder

	AddFloat(val float32) BloomFilterBuilder

	BuildBloomFilter() *BloomFilter
}

func NewNoOpBloomFilterBuilder

func NewNoOpBloomFilterBuilder() BloomFilterBuilder

type BooleanStatistics

type BooleanStatistics struct {
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewBooleanStatistics

func NewBooleanStatistics(trueValueCount int64) *BooleanStatistics

func (*BooleanStatistics) Equals

func (bs *BooleanStatistics) Equals(o *BooleanStatistics) bool

@Override

func (*BooleanStatistics) GetRetainedSizeInBytes

func (bs *BooleanStatistics) GetRetainedSizeInBytes() int64

func (*BooleanStatistics) GetTrueValueCount

func (bs *BooleanStatistics) GetTrueValueCount() int64

func (*BooleanStatistics) ToString

func (bs *BooleanStatistics) ToString() string

@Override

type BooleanStatisticsBuilder

type BooleanStatisticsBuilder struct {
	// 继承
	StatisticsBuilder
	// contains filtered or unexported fields
}

func NewBooleanStatisticsBuilder

func NewBooleanStatisticsBuilder() *BooleanStatisticsBuilder

func (*BooleanStatisticsBuilder) AddBlock

func (br *BooleanStatisticsBuilder) AddBlock(kind block.Type, block block.Block)

@Override

func (*BooleanStatisticsBuilder) AddValue

func (br *BooleanStatisticsBuilder) AddValue(value bool)

func (*BooleanStatisticsBuilder) BuildColumnStatistics

func (br *BooleanStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type ColumnEncoding

type ColumnEncoding struct {
	// contains filtered or unexported fields
}

func NewColumnEncoding

func NewColumnEncoding(columnEncodingKind ColumnEncodingKind, dictionarySize uint32) *ColumnEncoding

func (*ColumnEncoding) GetColumnEncodingKind

func (cg *ColumnEncoding) GetColumnEncodingKind() ColumnEncodingKind

func (*ColumnEncoding) GetDictionarySize

func (cg *ColumnEncoding) GetDictionarySize() uint32

func (*ColumnEncoding) GetDictionarySizePtr

func (cg *ColumnEncoding) GetDictionarySizePtr() *uint32

func (*ColumnEncoding) String

func (cg *ColumnEncoding) String() string

type ColumnEncodingKind

type ColumnEncodingKind int8
const (
	DIRECT ColumnEncodingKind = iota
	DICTIONARY
	DIRECT_V2
	DICTIONARY_V2
)

type ColumnMetadata

type ColumnMetadata[T basic.Object] struct {
	// contains filtered or unexported fields
}

func CreateRootMothType

func CreateRootMothType(fieldNames *util.ArrayList[string], fieldTypes *util.ArrayList[block.Type]) *ColumnMetadata[*MothType]

ColumnMetadata<MothType> createRootMothType(List<String> fieldNames, List<Type> fieldTypes)

func NewColumnMetadata

func NewColumnMetadata[T basic.Object](metadata *util.ArrayList[T]) *ColumnMetadata[T]

func (*ColumnMetadata[T]) Get

func (ca *ColumnMetadata[T]) Get(columnId MothColumnId) T

func (*ColumnMetadata[T]) List

func (ca *ColumnMetadata[T]) List() *util.ArrayList[T]

func (*ColumnMetadata[T]) Size

func (ca *ColumnMetadata[T]) Size() int32

func (*ColumnMetadata[T]) Stream

func (ca *ColumnMetadata[T]) Stream() *util.Stream[T]

func (*ColumnMetadata[T]) String

func (ca *ColumnMetadata[T]) String() string

type ColumnStatistics

type ColumnStatistics struct {
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func MergeColumnStatistics

func MergeColumnStatistics(stats *util.ArrayList[*ColumnStatistics]) *ColumnStatistics

func NewColumnStatistics

func NewColumnStatistics(numberOfValues int64, minAverageValueSizeInBytes int64, booleanStatistics *BooleanStatistics, integerStatistics *IntegerStatistics, doubleStatistics *DoubleStatistics, stringStatistics *StringStatistics, dateStatistics *DateStatistics, timestampStatistics *TimestampStatistics, decimalStatistics *DecimalStatistics, binaryStatistics *BinaryStatistics, bloomFilter *BloomFilter) *ColumnStatistics

func (*ColumnStatistics) AddHash

func (cs *ColumnStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*ColumnStatistics) GetBinaryStatistics

func (cs *ColumnStatistics) GetBinaryStatistics() *BinaryStatistics

func (*ColumnStatistics) GetBloomFilter

func (cs *ColumnStatistics) GetBloomFilter() *BloomFilter

func (*ColumnStatistics) GetBooleanStatistics

func (cs *ColumnStatistics) GetBooleanStatistics() *BooleanStatistics

func (*ColumnStatistics) GetDateStatistics

func (cs *ColumnStatistics) GetDateStatistics() *DateStatistics

func (*ColumnStatistics) GetDecimalStatistics

func (cs *ColumnStatistics) GetDecimalStatistics() *DecimalStatistics

func (*ColumnStatistics) GetDoubleStatistics

func (cs *ColumnStatistics) GetDoubleStatistics() *DoubleStatistics

func (*ColumnStatistics) GetIntegerStatistics

func (cs *ColumnStatistics) GetIntegerStatistics() *IntegerStatistics

func (*ColumnStatistics) GetMinAverageValueSizeInBytes

func (cs *ColumnStatistics) GetMinAverageValueSizeInBytes() int64

func (*ColumnStatistics) GetNumberOfValues

func (cs *ColumnStatistics) GetNumberOfValues() int64

func (*ColumnStatistics) GetNumberOfValuesPtr

func (cs *ColumnStatistics) GetNumberOfValuesPtr() *uint64

func (*ColumnStatistics) GetRetainedSizeInBytes

func (cs *ColumnStatistics) GetRetainedSizeInBytes() int64

func (*ColumnStatistics) GetStringStatistics

func (cs *ColumnStatistics) GetStringStatistics() *StringStatistics

func (*ColumnStatistics) GetTimestampStatistics

func (cs *ColumnStatistics) GetTimestampStatistics() *TimestampStatistics

func (*ColumnStatistics) HasMinAverageValueSizeInBytes

func (cs *ColumnStatistics) HasMinAverageValueSizeInBytes() bool

func (*ColumnStatistics) HasNumberOfValues

func (cs *ColumnStatistics) HasNumberOfValues() bool

func (*ColumnStatistics) WithBloomFilter

func (cs *ColumnStatistics) WithBloomFilter(bloomFilter *BloomFilter) *ColumnStatistics

type CompressionKind

type CompressionKind int8
const (
	NONE CompressionKind = iota
	ZLIB
	SNAPPY
	LZ4
	ZSTD
)

type DateStatistics

type DateStatistics struct {
	// 继承
	RangeStatistics[int32]
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewDateStatistics

func NewDateStatistics(minimum int32, maximum int32) *DateStatistics

func (*DateStatistics) AddHash

func (ds *DateStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*DateStatistics) GetMax

func (ds *DateStatistics) GetMax() int32

@Override

func (*DateStatistics) GetMaxPtr

func (ds *DateStatistics) GetMaxPtr() *int32

@Override

func (*DateStatistics) GetMin

func (ds *DateStatistics) GetMin() int32

@Override

func (*DateStatistics) GetMinPtr

func (ds *DateStatistics) GetMinPtr() *int32

@Override

func (*DateStatistics) GetRetainedSizeInBytes

func (ds *DateStatistics) GetRetainedSizeInBytes() int64

@Override

func (*DateStatistics) ToString

func (ds *DateStatistics) ToString() string

@Override

type DateStatisticsBuilder

type DateStatisticsBuilder struct {
	// 继承
	LongValueStatisticsBuilder
	// contains filtered or unexported fields
}

func NewDateStatisticsBuilder

func NewDateStatisticsBuilder(bloomFilterBuilder BloomFilterBuilder) *DateStatisticsBuilder

func (*DateStatisticsBuilder) AddValue

func (dr *DateStatisticsBuilder) AddValue(value int64)

@Override

func (*DateStatisticsBuilder) BuildColumnStatistics

func (dr *DateStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type DecimalStatistics

type DecimalStatistics struct {
	// 继承
	RangeStatistics[*decimal.Decimal]
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewDecimalStatistics

func NewDecimalStatistics(minimum *decimal.Decimal, maximum *decimal.Decimal, decimalSizeInBytes int64) *DecimalStatistics

func (*DecimalStatistics) AddHash

func (ds *DecimalStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*DecimalStatistics) GetMax

func (ds *DecimalStatistics) GetMax() *decimal.Decimal

@Override

func (*DecimalStatistics) GetMaxPtr

func (ds *DecimalStatistics) GetMaxPtr() *string

@Override

func (*DecimalStatistics) GetMin

func (ds *DecimalStatistics) GetMin() *decimal.Decimal

@Override

func (*DecimalStatistics) GetMinPtr

func (ds *DecimalStatistics) GetMinPtr() *string

@Override

func (*DecimalStatistics) GetRetainedSizeInBytes

func (ds *DecimalStatistics) GetRetainedSizeInBytes() int64

@Override

func (*DecimalStatistics) String

func (ds *DecimalStatistics) String() string

@Override

type DoubleStatistics

type DoubleStatistics struct {
	// contains filtered or unexported fields
}

func NewDoubleStatistics

func NewDoubleStatistics(minimum float64, maximum float64) *DoubleStatistics

func (*DoubleStatistics) AddHash

func (ds *DoubleStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*DoubleStatistics) GetMax

func (ds *DoubleStatistics) GetMax() float64

@Override

func (*DoubleStatistics) GetMaxPtr

func (ds *DoubleStatistics) GetMaxPtr() *float64

@Override

func (*DoubleStatistics) GetMin

func (ds *DoubleStatistics) GetMin() float64

@Override

func (*DoubleStatistics) GetMinPtr

func (ds *DoubleStatistics) GetMinPtr() *float64

@Override

func (*DoubleStatistics) GetRetainedSizeInBytes

func (ds *DoubleStatistics) GetRetainedSizeInBytes() int64

@Override

func (*DoubleStatistics) ToString

func (ds *DoubleStatistics) ToString() string

@Override

type DoubleStatisticsBuilder

type DoubleStatisticsBuilder struct {
	// 继承
	StatisticsBuilder
	// contains filtered or unexported fields
}

func NewDoubleStatisticsBuilder

func NewDoubleStatisticsBuilder(bloomFilterBuilder BloomFilterBuilder) *DoubleStatisticsBuilder

func (*DoubleStatisticsBuilder) AddBlock

func (dr *DoubleStatisticsBuilder) AddBlock(kind block.Type, b block.Block)

@Override

func (*DoubleStatisticsBuilder) AddValue

func (dr *DoubleStatisticsBuilder) AddValue(value float64)

func (*DoubleStatisticsBuilder) AddValue2

func (dr *DoubleStatisticsBuilder) AddValue2(value float32)

func (*DoubleStatisticsBuilder) BuildColumnStatistics

func (dr *DoubleStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type ExceptionWrappingMetadataReader

type ExceptionWrappingMetadataReader struct {
	// 继承
	MetadataReader
	// contains filtered or unexported fields
}

func NewExceptionWrappingMetadataReader

func NewExceptionWrappingMetadataReader(mothDataSourceId *common.MothDataSourceId, delegate MetadataReader) *ExceptionWrappingMetadataReader

func (*ExceptionWrappingMetadataReader) ReadBloomFilterIndexes

func (er *ExceptionWrappingMetadataReader) ReadBloomFilterIndexes(inputStream mothio.InputStream) *util.ArrayList[*BloomFilter]

@Override

func (*ExceptionWrappingMetadataReader) ReadFooter

func (er *ExceptionWrappingMetadataReader) ReadFooter(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Footer

@Override

func (*ExceptionWrappingMetadataReader) ReadMetadata

func (er *ExceptionWrappingMetadataReader) ReadMetadata(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Metadata

@Override

func (*ExceptionWrappingMetadataReader) ReadPostScript

func (er *ExceptionWrappingMetadataReader) ReadPostScript(inputStream mothio.InputStream) *PostScript

@Override

func (*ExceptionWrappingMetadataReader) ReadRowIndexes

func (er *ExceptionWrappingMetadataReader) ReadRowIndexes(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *util.ArrayList[*RowGroupIndex]

@Override

func (*ExceptionWrappingMetadataReader) ReadStripeFooter

func (er *ExceptionWrappingMetadataReader) ReadStripeFooter(types *ColumnMetadata[*MothType], inputStream mothio.InputStream, legacyFileTimeZone *time.Location) *StripeFooter

@Override

type Footer struct {
	// contains filtered or unexported fields
}

func NewFooter

func NewFooter(numberOfRows uint64, rowsInRowGroup *optional.OptionalInt, stripes *util.ArrayList[*StripeInformation], types *ColumnMetadata[*MothType], fileStats *optional.Optional[*ColumnMetadata[*ColumnStatistics]], userMetadata map[string]*slice.Slice, writerId *optional.Optional[uint32]) *Footer

func (*Footer) GetFileStats

func (fr *Footer) GetFileStats() *optional.Optional[*ColumnMetadata[*ColumnStatistics]]

func (*Footer) GetNumberOfRows

func (fr *Footer) GetNumberOfRows() uint64

func (*Footer) GetRowsInRowGroup

func (fr *Footer) GetRowsInRowGroup() *optional.OptionalInt

func (*Footer) GetStripes

func (fr *Footer) GetStripes() *util.ArrayList[*StripeInformation]

func (*Footer) GetTypes

func (fr *Footer) GetTypes() *ColumnMetadata[*MothType]

func (*Footer) GetUserMetadata

func (fr *Footer) GetUserMetadata() map[string]*slice.Slice

func (*Footer) GetWriterId

func (fr *Footer) GetWriterId() *optional.Optional[uint32]

type Hashable

type Hashable interface {
	AddHash(hasher *StatisticsHasher)
}

type HiveWriterVersion

type HiveWriterVersion int8
const (
	ORIGINAL HiveWriterVersion = iota
	MOTH_HIVE_8732
)

type IntegerStatistics

type IntegerStatistics struct {
	// 继承
	RangeStatistics[int64]
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewIntegerStatistics

func NewIntegerStatistics(minimum int64, maximum int64, sum int64) *IntegerStatistics

func (*IntegerStatistics) AddHash

func (is *IntegerStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*IntegerStatistics) GetMax

func (is *IntegerStatistics) GetMax() int64

@Override

func (*IntegerStatistics) GetMaxPtr

func (is *IntegerStatistics) GetMaxPtr() *int64

@Override

func (*IntegerStatistics) GetMin

func (is *IntegerStatistics) GetMin() int64

@Override

func (*IntegerStatistics) GetMinPtr

func (is *IntegerStatistics) GetMinPtr() *int64

@Override

func (*IntegerStatistics) GetRetainedSizeInBytes

func (is *IntegerStatistics) GetRetainedSizeInBytes() int64

@Override

func (*IntegerStatistics) GetSum

func (is *IntegerStatistics) GetSum() int64

func (*IntegerStatistics) GetSumPtr

func (is *IntegerStatistics) GetSumPtr() *int64

func (*IntegerStatistics) String

func (is *IntegerStatistics) String() string

@Override

type IntegerStatisticsBuilder

type IntegerStatisticsBuilder struct {
	// 继承
	LongValueStatisticsBuilder
	// contains filtered or unexported fields
}

func NewIntegerStatisticsBuilder

func NewIntegerStatisticsBuilder(bloomFilterBuilder BloomFilterBuilder) *IntegerStatisticsBuilder

func (*IntegerStatisticsBuilder) AddValue

func (ir *IntegerStatisticsBuilder) AddValue(value int64)

@Override

func (*IntegerStatisticsBuilder) BuildColumnStatistics

func (ir *IntegerStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type LongDecimalStatisticsBuilder

type LongDecimalStatisticsBuilder struct {
	// 继承
	StatisticsBuilder
	// contains filtered or unexported fields
}

func NewLongDecimalStatisticsBuilder

func NewLongDecimalStatisticsBuilder() *LongDecimalStatisticsBuilder

func (*LongDecimalStatisticsBuilder) AddBlock

func (lr *LongDecimalStatisticsBuilder) AddBlock(kind block.Type, b block.Block)

@Override

func (*LongDecimalStatisticsBuilder) AddValue

func (lr *LongDecimalStatisticsBuilder) AddValue(value *decimal.Decimal)

func (*LongDecimalStatisticsBuilder) BuildColumnStatistics

func (lr *LongDecimalStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type LongValueStatisticsBuilder

type LongValueStatisticsBuilder interface {
	//继承
	StatisticsBuilder

	// default void addBlock(Type type, block.Block block)
	// {
	//     for (int position = 0; position < block.GetPositionCount(); position++) {
	//         if (!block.IsNull(position)) {
	//             addValue(getValueFromBlock(type, block, position));
	//         }
	//     }
	// }
	AddBlock(kind block.Type, block block.Block)

	// default long getValueFromBlock(Type type, block.Block block, int position)
	// {
	//     return type.getLong(block, position);
	// }
	GetValueFromBlock(kind block.Type, block block.Block, position int32) int64
	AddValue(value int64)
}

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

func NewMetadata

func NewMetadata(stripeStatistics *util.ArrayList[*optional.Optional[*StripeStatistics]]) *Metadata

func (*Metadata) GetStripeStatsList

func (ma *Metadata) GetStripeStatsList() *util.ArrayList[*optional.Optional[*StripeStatistics]]

type MetadataReader

type MetadataReader interface {

	/**
	 * Read
	 */
	ReadPostScript(inputStream mothio.InputStream) *PostScript

	/**
	 * hiveWriterVersion
	 */
	ReadMetadata(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Metadata

	/**
	 * hiveWriterVersion
	 */
	ReadFooter(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Footer

	/**
	 * types
	 */
	ReadStripeFooter(types *ColumnMetadata[*MothType], inputStream mothio.InputStream, legacyFileTimeZone *time.Location) *StripeFooter

	/**
	 * hiveWriterVersion
	 */
	ReadRowIndexes(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *util.ArrayList[*RowGroupIndex]

	/**
	 * Reader
	 */
	ReadBloomFilterIndexes(inputStream mothio.InputStream) *util.ArrayList[*BloomFilter]
}

type MetadataWriter

type MetadataWriter interface {

	/**
	 * List<Integer> getMothMetadataVersion();
	 */
	GetMothMetadataVersion() []uint32

	WritePostscript(output slice.SliceOutput, footerLength uint64, metadataLength uint64, compression CompressionKind, compressionBlockSize uint64) int32

	WriteMetadata(output slice.SliceOutput, metadata *Metadata) int32

	WriteFooter(output slice.SliceOutput, footer *Footer) int32

	WriteStripeFooter(output slice.SliceOutput, footer *StripeFooter) int32

	WriteRowIndexes(output slice.SliceOutput, rowGroupIndexes *util.ArrayList[*RowGroupIndex]) int32

	WriteBloomFilters(output slice.SliceOutput, bloomFilters *util.ArrayList[*BloomFilter]) int32
}

type MothColumnId

type MothColumnId uint32
var ROOT_COLUMN MothColumnId = NewMothColumnId(0)

func NewMothColumnId

func NewMothColumnId(id uint32) MothColumnId

func (MothColumnId) CompareTo

func (md MothColumnId) CompareTo(o MothColumnId) uint32

@Override

func (MothColumnId) Equals

func (md MothColumnId) Equals(o MothColumnId) bool

@Override

func (MothColumnId) GetId

func (md MothColumnId) GetId() uint32

func (MothColumnId) GetIdPtr

func (md MothColumnId) GetIdPtr() *uint32

func (MothColumnId) String

func (md MothColumnId) String() string

@Override

type MothMetadataReader

type MothMetadataReader struct {
	MetadataReader
}

func NewMothMetadataReader

func NewMothMetadataReader() *MothMetadataReader

func (*MothMetadataReader) ReadBloomFilterIndexes

func (mr *MothMetadataReader) ReadBloomFilterIndexes(inputStream mothio.InputStream) *util.ArrayList[*BloomFilter]

@Override

func (*MothMetadataReader) ReadFooter

func (mr *MothMetadataReader) ReadFooter(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Footer

@Override

func (*MothMetadataReader) ReadMetadata

func (mr *MothMetadataReader) ReadMetadata(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *Metadata

@Override

func (*MothMetadataReader) ReadPostScript

func (mr *MothMetadataReader) ReadPostScript(inputStream mothio.InputStream) *PostScript

@Override

func (*MothMetadataReader) ReadRowIndexes

func (mr *MothMetadataReader) ReadRowIndexes(hiveWriterVersion HiveWriterVersion, inputStream mothio.InputStream) *util.ArrayList[*RowGroupIndex]

@Override

func (*MothMetadataReader) ReadStripeFooter

func (mr *MothMetadataReader) ReadStripeFooter(types *ColumnMetadata[*MothType], inputStream mothio.InputStream, legacyFileTimeZone *time.Location) *StripeFooter

@Override

type MothMetadataWriter

type MothMetadataWriter struct {
	// 继承
	MetadataWriter
	// contains filtered or unexported fields
}

func NewMothMetadataWriter

func NewMothMetadataWriter(writerIdentification WriterIdentification) *MothMetadataWriter

func (*MothMetadataWriter) GetMothMetadataVersion

func (mr *MothMetadataWriter) GetMothMetadataVersion() []uint32

@Override

func (*MothMetadataWriter) WriteBloomFilters

func (mr *MothMetadataWriter) WriteBloomFilters(output slice.SliceOutput, bloomFilters *util.ArrayList[*BloomFilter]) int32

@Override

func (*MothMetadataWriter) WriteFooter

func (mr *MothMetadataWriter) WriteFooter(output slice.SliceOutput, footer *Footer) int32

@Override

func (*MothMetadataWriter) WriteMetadata

func (mr *MothMetadataWriter) WriteMetadata(output slice.SliceOutput, metadata *Metadata) int32

@Override

func (*MothMetadataWriter) WritePostscript

func (mr *MothMetadataWriter) WritePostscript(output slice.SliceOutput, footerLength uint64, metadataLength uint64, compression CompressionKind, compressionBlockSize uint64) int32

@Override

func (*MothMetadataWriter) WriteRowIndexes

func (mr *MothMetadataWriter) WriteRowIndexes(output slice.SliceOutput, rowGroupIndexes *util.ArrayList[*RowGroupIndex]) int32

@Override

func (*MothMetadataWriter) WriteStripeFooter

func (mr *MothMetadataWriter) WriteStripeFooter(output slice.SliceOutput, footer *StripeFooter) int32

@Override

type MothMurmur3

type MothMurmur3 struct {
}

func NewMothMurmur3

func NewMothMurmur3() *MothMurmur3

type MothType

type MothType struct {
	// contains filtered or unexported fields
}

func NewMothType

func NewMothType(mothTypeKind MothTypeKind) *MothType

func NewMothType2

func NewMothType2(mothTypeKind MothTypeKind, length int32) *MothType

func NewMothType3

func NewMothType3(mothTypeKind MothTypeKind, precision int32, scale int32) *MothType

func NewMothType4

func NewMothType4(mothTypeKind MothTypeKind, fieldTypeIndexes *util.ArrayList[MothColumnId], fieldNames *util.ArrayList[string]) *MothType

func NewMothType5

func NewMothType5(mothTypeKind MothTypeKind, fieldTypeIndexes *util.ArrayList[MothColumnId], fieldNames *util.ArrayList[string], length *optional.Optional[int32], precision *optional.Optional[int32], scale *optional.Optional[int32], attributes map[string]string) *MothType

func (*MothType) GetAttributes

func (me *MothType) GetAttributes() map[string]string

func (*MothType) GetFieldCount

func (me *MothType) GetFieldCount() int32

func (*MothType) GetFieldName

func (me *MothType) GetFieldName(field int32) string

func (*MothType) GetFieldNames

func (me *MothType) GetFieldNames() *util.ArrayList[string]

func (*MothType) GetFieldTypeIndex

func (me *MothType) GetFieldTypeIndex(field int32) MothColumnId

func (*MothType) GetFieldTypeIndexes

func (me *MothType) GetFieldTypeIndexes() *util.ArrayList[MothColumnId]

func (*MothType) GetLength

func (me *MothType) GetLength() *optional.Optional[int32]

func (*MothType) GetMothTypeKind

func (me *MothType) GetMothTypeKind() MothTypeKind

func (*MothType) GetPrecision

func (me *MothType) GetPrecision() *optional.Optional[int32]

func (*MothType) GetScale

func (me *MothType) GetScale() *optional.Optional[int32]

type MothTypeKind

type MothTypeKind int8
const (
	BOOLEAN MothTypeKind = iota
	BYTE
	SHORT
	INT
	LONG
	DECIMAL
	FLOAT
	DOUBLE
	STRING
	VARCHAR
	CHAR
	BINARY
	DATE
	TIMESTAMP
	TIMESTAMP_INSTANT
	LIST
	MAP
	STRUCT
	UNION
)

type NoOpBloomFilterBuilder

type NoOpBloomFilterBuilder struct {
	// 继承
	BloomFilterBuilder
}

func (*NoOpBloomFilterBuilder) AddDouble

@Override

func (*NoOpBloomFilterBuilder) AddFloat

@Override

func (*NoOpBloomFilterBuilder) AddLong

@Override

func (*NoOpBloomFilterBuilder) AddString

@Override

func (*NoOpBloomFilterBuilder) BuildBloomFilter

func (nr *NoOpBloomFilterBuilder) BuildBloomFilter() *BloomFilter

@Override

type PostScript

type PostScript struct {
	// contains filtered or unexported fields
}

func NewPostScript

func NewPostScript(version []uint32, footerLength int64, metadataLength int64, compression CompressionKind, compressionBlockSize uint64, hiveWriterVersion HiveWriterVersion) *PostScript

func (*PostScript) GetCompression

func (pt *PostScript) GetCompression() CompressionKind

func (*PostScript) GetCompressionBlockSize

func (pt *PostScript) GetCompressionBlockSize() uint64

func (*PostScript) GetFooterLength

func (pt *PostScript) GetFooterLength() int64

func (*PostScript) GetHiveWriterVersion

func (pt *PostScript) GetHiveWriterVersion() HiveWriterVersion

func (*PostScript) GetMetadataLength

func (pt *PostScript) GetMetadataLength() int64

func (*PostScript) GetVersion

func (pt *PostScript) GetVersion() []uint32

type RangeStatistics

type RangeStatistics[T basic.Object] interface {
	GetMin() T
	GetMax() T
	GetRetainedSizeInBytes() int64
}

type RowGroupIndex

type RowGroupIndex struct {
	// contains filtered or unexported fields
}

func NewRowGroupIndex

func NewRowGroupIndex(positions *util.ArrayList[int32], statistics *ColumnStatistics) *RowGroupIndex

func (*RowGroupIndex) GetColumnStatistics

func (rx *RowGroupIndex) GetColumnStatistics() *ColumnStatistics

func (*RowGroupIndex) GetPositions

func (rx *RowGroupIndex) GetPositions() *util.ArrayList[int32]

type ShortDecimalStatisticsBuilder

type ShortDecimalStatisticsBuilder struct {
	// 继承
	LongValueStatisticsBuilder
	// contains filtered or unexported fields
}

func NewShortDecimalStatisticsBuilder

func NewShortDecimalStatisticsBuilder(scale int32) *ShortDecimalStatisticsBuilder

func (*ShortDecimalStatisticsBuilder) AddValue

func (sr *ShortDecimalStatisticsBuilder) AddValue(value int64)

@Override

func (*ShortDecimalStatisticsBuilder) BuildColumnStatistics

func (sr *ShortDecimalStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

type SliceColumnStatisticsBuilder

type SliceColumnStatisticsBuilder interface {
	// 继承
	StatisticsBuilder

	// @Override
	// default void addBlock(Type type, block.Block block)
	// {
	//     for (int position = 0; position < block.GetPositionCount(); position++) {
	//         if (!block.IsNull(position)) {
	//             addValue(type.getSlice(block, position));
	//         }
	//     }
	// }
	AddBlock(kind block.Type, block block.Block)

	AddValue(value *slice.Slice)
}

type StatisticsBuilder

type StatisticsBuilder interface {
	AddBlock(kind block.Type, block block.Block)

	BuildColumnStatistics() *ColumnStatistics
}

type StatisticsHasher

type StatisticsHasher struct {
	// contains filtered or unexported fields
}

func NewStatisticsHasher

func NewStatisticsHasher(hasher hash.Hash) *StatisticsHasher

func (*StatisticsHasher) Hash

func (sr *StatisticsHasher) Hash() int64

func (*StatisticsHasher) PutInt

func (sr *StatisticsHasher) PutInt(value int32) *StatisticsHasher

func (*StatisticsHasher) PutLong

func (sr *StatisticsHasher) PutLong(value int64) *StatisticsHasher

func (*StatisticsHasher) PutLongs

func (sr *StatisticsHasher) PutLongs(array []int64)

func (*StatisticsHasher) PutOptionalBigDecimal

func (sr *StatisticsHasher) PutOptionalBigDecimal(value *decimal.Decimal) *StatisticsHasher

func (*StatisticsHasher) PutOptionalDouble

func (sr *StatisticsHasher) PutOptionalDouble(present bool, value float64) *StatisticsHasher

func (*StatisticsHasher) PutOptionalHashable

func (sr *StatisticsHasher) PutOptionalHashable(value Hashable) *StatisticsHasher

func (*StatisticsHasher) PutOptionalInt

func (sr *StatisticsHasher) PutOptionalInt(present bool, value int32) *StatisticsHasher

func (*StatisticsHasher) PutOptionalLong

func (sr *StatisticsHasher) PutOptionalLong(present bool, value int64) *StatisticsHasher

func (*StatisticsHasher) PutOptionalSlice

func (sr *StatisticsHasher) PutOptionalSlice(value *slice.Slice) *StatisticsHasher

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func NewStream

func NewStream(columnId MothColumnId, streamKind StreamKind, length int32, useVInts bool) *Stream

func (*Stream) GetColumnId

func (sm *Stream) GetColumnId() MothColumnId

func (*Stream) GetLength

func (sm *Stream) GetLength() int32

func (*Stream) GetLengthPtr

func (sm *Stream) GetLengthPtr() *uint64

func (*Stream) GetStreamKind

func (sm *Stream) GetStreamKind() StreamKind

func (*Stream) IsUseVInts

func (sm *Stream) IsUseVInts() bool

func (*Stream) LenInt64

func (sm *Stream) LenInt64() int64

func (*Stream) String

func (sm *Stream) String() string

@Override

type StreamKind

type StreamKind int8
const (
	PRESENT StreamKind = iota
	DATA
	LENGTH
	DICTIONARY_DATA
	DICTIONARY_COUNT
	SECONDARY
	ROW_INDEX
	BLOOM_FILTER
	BLOOM_FILTER_UTF8
)

type StringStatistics

type StringStatistics struct {

	// 继承
	RangeStatistics[*slice.Slice]
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewStringStatistics

func NewStringStatistics(minimum *slice.Slice, maximum *slice.Slice, sum int64) *StringStatistics

func (*StringStatistics) AddHash

func (ss *StringStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*StringStatistics) GetMax

func (ss *StringStatistics) GetMax() *slice.Slice

@Override

func (*StringStatistics) GetMin

func (ss *StringStatistics) GetMin() *slice.Slice

@Override

func (*StringStatistics) GetRetainedSizeInBytes

func (ss *StringStatistics) GetRetainedSizeInBytes() int64

@Override

func (*StringStatistics) GetSum

func (ss *StringStatistics) GetSum() int64

func (*StringStatistics) GetSumPtr

func (ss *StringStatistics) GetSumPtr() *int64

func (*StringStatistics) ToString

func (ss *StringStatistics) ToString() string

@Override

type StringStatisticsBuilder

type StringStatisticsBuilder struct {

	// 继承
	SliceColumnStatisticsBuilder
	// contains filtered or unexported fields
}

func NewStringStatisticsBuilder

func NewStringStatisticsBuilder(stringStatisticsLimitInBytes int32, bloomFilterBuilder BloomFilterBuilder) *StringStatisticsBuilder

func NewStringStatisticsBuilder2

func NewStringStatisticsBuilder2(stringStatisticsLimitInBytes int32, nonNullValueCount int64, minimum *slice.Slice, maximum *slice.Slice, sum int64, bloomFilterBuilder BloomFilterBuilder) *StringStatisticsBuilder

func (*StringStatisticsBuilder) AddValue

func (sr *StringStatisticsBuilder) AddValue(value *slice.Slice)

@Override

func (*StringStatisticsBuilder) BuildColumnStatistics

func (sr *StringStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

func (*StringStatisticsBuilder) GetNonNullValueCount

func (sr *StringStatisticsBuilder) GetNonNullValueCount() int64

type StripeFooter

type StripeFooter struct {
	// contains filtered or unexported fields
}

func NewStripeFooter

func NewStripeFooter(streams *util.ArrayList[*Stream], columnEncodings *ColumnMetadata[*ColumnEncoding], timeZone *time.Location) *StripeFooter

func (*StripeFooter) GetColumnEncodings

func (sr *StripeFooter) GetColumnEncodings() *ColumnMetadata[*ColumnEncoding]

func (*StripeFooter) GetStreams

func (sr *StripeFooter) GetStreams() *util.ArrayList[*Stream]

func (*StripeFooter) GetTimeZone

func (sr *StripeFooter) GetTimeZone() *time.Location

type StripeInformation

type StripeInformation struct {
	// contains filtered or unexported fields
}

func NewStripeInformation

func NewStripeInformation(numberOfRows int32, offset uint64, indexLength uint64, dataLength uint64, footerLength uint64) *StripeInformation

func (*StripeInformation) GetDataLength

func (sn *StripeInformation) GetDataLength() uint64

func (*StripeInformation) GetFooterLength

func (sn *StripeInformation) GetFooterLength() uint64

func (*StripeInformation) GetIndexLength

func (sn *StripeInformation) GetIndexLength() uint64

func (*StripeInformation) GetNumberOfRows

func (sn *StripeInformation) GetNumberOfRows() int32

func (*StripeInformation) GetOffset

func (sn *StripeInformation) GetOffset() uint64

func (*StripeInformation) GetTotalLength

func (sn *StripeInformation) GetTotalLength() uint64

func (*StripeInformation) String

func (sn *StripeInformation) String() string

@Override

type StripeStatistics

type StripeStatistics struct {
	// contains filtered or unexported fields
}

func NewStripeStatistics

func NewStripeStatistics(columnStatistics *ColumnMetadata[*ColumnStatistics]) *StripeStatistics

func (*StripeStatistics) GetColumnStatistics

func (ss *StripeStatistics) GetColumnStatistics() *ColumnMetadata[*ColumnStatistics]

func (*StripeStatistics) GetRetainedSizeInBytes

func (ss *StripeStatistics) GetRetainedSizeInBytes() int64

type TimestampStatistics

type TimestampStatistics struct {
	// 继承
	RangeStatistics[int64]
	// 继承
	Hashable
	// contains filtered or unexported fields
}

func NewTimestampStatistics

func NewTimestampStatistics(minimum int64, maximum int64) *TimestampStatistics

func (*TimestampStatistics) AddHash

func (ts *TimestampStatistics) AddHash(hasher *StatisticsHasher)

@Override

func (*TimestampStatistics) GetMax

func (ts *TimestampStatistics) GetMax() int64

@Override

func (*TimestampStatistics) GetMaxPtr

func (ts *TimestampStatistics) GetMaxPtr() *int64

@Override

func (*TimestampStatistics) GetMin

func (ts *TimestampStatistics) GetMin() int64

@Override

func (*TimestampStatistics) GetMinPtr

func (ts *TimestampStatistics) GetMinPtr() *int64

@Override

func (*TimestampStatistics) GetRetainedSizeInBytes

func (ts *TimestampStatistics) GetRetainedSizeInBytes() int64

@Override

func (*TimestampStatistics) ToString

func (ts *TimestampStatistics) ToString() string

@Override

type TimestampStatisticsBuilder

type TimestampStatisticsBuilder struct {
	// 继承
	LongValueStatisticsBuilder
	// contains filtered or unexported fields
}

func NewTimestampStatisticsBuilder

func NewTimestampStatisticsBuilder(bloomFilterBuilder BloomFilterBuilder) *TimestampStatisticsBuilder

func NewTimestampStatisticsBuilder2

func NewTimestampStatisticsBuilder2(millisFunction func(_ block.Type, block block.Block, position int32) int64) *TimestampStatisticsBuilder

func NewTimestampStatisticsBuilder3

func NewTimestampStatisticsBuilder3(bloomFilterBuilder BloomFilterBuilder, millisFunction func(_ block.Type, block block.Block, position int32) int64) *TimestampStatisticsBuilder

func (*TimestampStatisticsBuilder) AddValue

func (tr *TimestampStatisticsBuilder) AddValue(value int64)

@Override

func (*TimestampStatisticsBuilder) BuildColumnStatistics

func (tr *TimestampStatisticsBuilder) BuildColumnStatistics() *ColumnStatistics

@Override

func (*TimestampStatisticsBuilder) GetValueFromBlock

func (tr *TimestampStatisticsBuilder) GetValueFromBlock(kind block.Type, block block.Block, position int32) int64

@Override

type Utf8BloomFilterBuilder

type Utf8BloomFilterBuilder struct {
	//继承
	BloomFilterBuilder
	// contains filtered or unexported fields
}

func NewUtf8BloomFilterBuilder

func NewUtf8BloomFilterBuilder(expectedSize int32, fpp float64) *Utf8BloomFilterBuilder

func (*Utf8BloomFilterBuilder) AddDouble

@Override

func (*Utf8BloomFilterBuilder) AddFloat

@Override

func (*Utf8BloomFilterBuilder) AddLong

@Override

func (*Utf8BloomFilterBuilder) AddString

@Override

func (*Utf8BloomFilterBuilder) BuildBloomFilter

func (ur *Utf8BloomFilterBuilder) BuildBloomFilter() *BloomFilter

@Override

type WriterIdentification

type WriterIdentification int8
const (
	/**
	 * Write MOTH files with a writer identification and version number that is readable by Hive 2.0.0 to 2.2.0
	 */
	LEGACY_HIVE_COMPATIBLE WriterIdentification = iota

	/**
	 * Write MOTH files with Moth writer identification.
	 */
	MOTH
)

Jump to

Keyboard shortcuts

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