Files
Joe ElliottandGitHub 90be636dde Update parquet go (#4654)
* update parquet-go

Signed-off-by: Joe Elliott <[email protected]>

* tolerate io.EOF in the wal iterator and find trace by id

Signed-off-by: Joe Elliott <[email protected]>

* add io.EOF check in test

Signed-off-by: Joe Elliott <[email protected]>

* add missing parquet file

Signed-off-by: Joe Elliott <[email protected]>

* update to latest

Signed-off-by: Joe Elliott <[email protected]>

* update again

Signed-off-by: Joe Elliott <[email protected]>

* that was kind of a good catch, linter ... but dont let it go to your head

Signed-off-by: Joe Elliott <[email protected]>

---------

Signed-off-by: Joe Elliott <[email protected]>
2025-02-04 07:56:47 -05:00

88 lines
3.4 KiB
Go

package parquet
import (
"errors"
"fmt"
)
var (
// ErrCorrupted is an error returned by the Err method of ColumnPages
// instances when they encountered a mismatch between the CRC checksum
// recorded in a page header and the one computed while reading the page
// data.
ErrCorrupted = errors.New("corrupted parquet page")
// ErrMissingRootColumn is an error returned when opening an invalid parquet
// file which does not have a root column.
ErrMissingRootColumn = errors.New("parquet file is missing a root column")
// ErrRowGroupSchemaMissing is an error returned when attempting to write a
// row group but the source has no schema.
ErrRowGroupSchemaMissing = errors.New("cannot write rows to a row group which has no schema")
// ErrRowGroupSchemaMismatch is an error returned when attempting to write a
// row group but the source and destination schemas differ.
ErrRowGroupSchemaMismatch = errors.New("cannot write row groups with mismatching schemas")
// ErrRowGroupSortingColumnsMismatch is an error returned when attempting to
// write a row group but the sorting columns differ in the source and
// destination.
ErrRowGroupSortingColumnsMismatch = errors.New("cannot write row groups with mismatching sorting columns")
// ErrSeekOutOfRange is an error returned when seeking to a row index which
// is less than the first row of a page.
ErrSeekOutOfRange = errors.New("seek to row index out of page range")
// ErrUnexpectedDictionaryPage is an error returned when a page reader
// encounters a dictionary page after the first page, or in a column
// which does not use a dictionary encoding.
ErrUnexpectedDictionaryPage = errors.New("unexpected dictionary page")
// ErrMissingPageHeader is an error returned when a page reader encounters
// a malformed page header which is missing page-type-specific information.
ErrMissingPageHeader = errors.New("missing page header")
// ErrUnexpectedRepetitionLevels is an error returned when attempting to
// decode repetition levels into a page which is not part of a repeated
// column.
ErrUnexpectedRepetitionLevels = errors.New("unexpected repetition levels")
// ErrUnexpectedDefinitionLevels is an error returned when attempting to
// decode definition levels into a page which is part of a required column.
ErrUnexpectedDefinitionLevels = errors.New("unexpected definition levels")
// ErrTooManyRowGroups is returned when attempting to generate a parquet
// file with more than MaxRowGroups row groups.
ErrTooManyRowGroups = errors.New("the limit of 32767 row groups has been reached")
// ErrConversion is used to indicate that a conversion betwen two values
// cannot be done because there are no rules to translate between their
// physical types.
ErrInvalidConversion = errors.New("invalid conversion between parquet values")
// ErrMalformedRepetitionLevel is returned when a page reader encounters
// a repetition level which does not start at the beginning of a row.
ErrMalformedRepetitionLevel = errors.New("parquet-go encountered a malformed data page which does not start at the beginning of a row")
)
type errno int
const (
ok errno = iota
indexOutOfBounds
)
func (e errno) check() {
switch e {
case ok:
case indexOutOfBounds:
panic("index out of bounds")
default:
panic("BUG: unknown error code")
}
}
func errRowIndexOutOfBounds(rowIndex, rowCount int64) error {
return fmt.Errorf("row index out of bounds: %d/%d", rowIndex, rowCount)
}