MCPcopy Create free account
hub / github.com/apache/paimon-rust / get_timestamp_raw

Method get_timestamp_raw

crates/paimon/src/spec/binary_row.rs:260–285  ·  view source on GitHub ↗
(
        &self,
        pos: usize,
        precision: u32,
    )

Source from the content-addressed store, hash-verified

258 }
259
260 pub(crate) fn get_timestamp_raw(
261 &self,
262 pos: usize,
263 precision: u32,
264 ) -> crate::Result<(i64, i32)> {
265 if precision <= 3 {
266 Ok((self.get_long(pos)?, 0))
267 } else {
268 let field_off = self.field_offset(pos);
269 let offset_and_nano = self.read_i64_at(field_off)? as u64;
270 let offset = (offset_and_nano >> 32) as usize;
271 let nano_of_milli = offset_and_nano as i32;
272
273 if offset + 8 > self.data.len() {
274 return Err(crate::Error::UnexpectedError {
275 message: format!(
276 "BinaryRow: non-compact Timestamp at pos {pos}: offset {offset} + 8 exceeds data length {}",
277 self.data.len()
278 ),
279 source: None,
280 });
281 }
282 let millis = i64::from_le_bytes(self.read_slice::<8>(offset)?);
283 Ok((millis, nano_of_milli))
284 }
285 }
286
287 pub fn hash_code(&self) -> i32 {
288 hash_by_words(&self.data)

Callers 5

get_datumMethod · 0.80
format_partition_valueFunction · 0.80
extract_datumFunction · 0.80

Calls 4

get_longMethod · 0.80
read_i64_atMethod · 0.80
field_offsetMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected