Skip to content

Commit

Permalink
add comment and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted-Jiang committed Jul 8, 2022
1 parent e8ecfea commit d18f459
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions parquet/src/file/page_index/index.rs
Expand Up @@ -56,6 +56,9 @@ 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,
/// Use `EMPTY_ARRAY` representing None will be more convenient.
EMPTY_ARRAY,
}

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::EMPTY_ARRAY());
return Ok(Index::EMPTY_ARRAY);
}
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 @@ -1249,7 +1249,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::EMPTY_ARRAY() = &page_indexes[0][10] {
if let Index::EMPTY_ARRAY = &page_indexes[0][10] {
assert_eq!(row_group_offset_indexes[10].len(), 974);
} else {
unreachable!()
Expand Down

0 comments on commit d18f459

Please sign in to comment.