Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent case in Index enumeration #2029

Merged
merged 1 commit into from Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions parquet/src/file/page_index/index.rs
Expand Up @@ -48,6 +48,10 @@ impl<T> PageIndex<T> {

#[derive(Debug, Clone, PartialEq)]
pub enum Index {
/// Sometimes reading page index from parquet file
/// will only return pageLocations without min_max index,
/// `NONE` represents this lack of index information
NONE,
BOOLEAN(BooleanIndex),
INT32(NativeIndex<i32>),
INT64(NativeIndex<i64>),
Expand All @@ -56,10 +60,6 @@ pub enum Index {
DOUBLE(NativeIndex<f64>),
BYTE_ARRAY(ByteArrayIndex),
FIXED_LEN_BYTE_ARRAY(ByteArrayIndex),
/// Sometimes reading page index from parquet file
/// will only return pageLocations without min_max index,
/// `None` represents this lack of index information
None,
}

/// An index of a column of [`Type`] physical representation
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/file/page_index/index_reader.rs
Expand Up @@ -138,7 +138,7 @@ fn deserialize_column_index(
column_type: Type,
) -> Result<Index, ParquetError> {
if data.is_empty() {
return Ok(Index::None);
return Ok(Index::NONE);
}
let mut d = Cursor::new(data);
let mut prot = TCompactInputProtocol::new(&mut d);
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/file/serialized_reader.rs
Expand Up @@ -1257,7 +1257,7 @@ mod tests {
};
//col11->timestamp_col: INT96 UNCOMPRESSED DO:0 FPO:490093 SZ:111948/111948/1.00 VC:7300 ENC:BIT_PACKED,RLE,PLAIN ST:[num_nulls: 0, min/max not defined]
//Notice: min_max values for each page for this col not exits.
if let Index::None = &page_indexes[0][10] {
if let Index::NONE = &page_indexes[0][10] {
assert_eq!(row_group_offset_indexes[10].len(), 974);
} else {
unreachable!()
Expand Down