Skip to content

Commit ecf70ae

Browse files
committed
Fix timestamp_index load code in Java
1 parent 1d8bd4e commit ecf70ae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/rust/qdbr/src/parquet_read/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ where
2323
pub row_group_count: u32,
2424
pub row_group_sizes_ptr: *const u32,
2525
pub row_group_sizes: AcVec<u32>,
26-
pub timestamp_index: Option<NonMaxU32>, // None (zero) means no designated timestamp
26+
pub timestamp_index: Option<NonMaxU32>, // None (~u32::MAX) means no designated timestamp
2727
pub columns_ptr: *const ColumnMeta,
2828
pub columns: AcVec<ColumnMeta>,
2929
reader: R,

core/src/main/java/io/questdb/griffin/engine/table/parquet/PartitionDecoder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ public int getRowGroupSize(int rowGroupIndex) {
307307
}
308308

309309
public int getTimestampIndex() {
310-
return Unsafe.getUnsafe().getInt(ptr + TIMESTAMP_INDEX_OFFSET);
310+
// The value is stored as Option<NonMaxU32> on the Rust side,
311+
// so we need to apply bitwise not to get the actual value.
312+
return ~Unsafe.getUnsafe().getInt(ptr + TIMESTAMP_INDEX_OFFSET);
311313
}
312314

313315
private void init() {

0 commit comments

Comments
 (0)