forked from segmentio/parquet-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
73 lines (58 loc) · 2.74 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package parquet
import (
"errors"
)
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")
)
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")
}
}