Update doc after rust / c++ panic fixes#395
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Rust client user-guide docs to match the recent change where InternalRow accessors return Result<T> (avoiding panics and requiring ? in examples).
Changes:
- Updated multiple Rust code snippets to propagate errors from
InternalRowgetters via?. - Updated the Rust API reference for
InternalRowto showResult<…>return types and includeis_null_at.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/user-guide/rust/example/primary-key-tables.md | Updates lookup example to use ? on row.get_* calls. |
| website/docs/user-guide/rust/example/partitioned-tables.md | Updates partitioned lookup example to use ? on row.get_long. |
| website/docs/user-guide/rust/example/log-tables.md | Updates log scanning examples to use ? on row.get_* calls. |
| website/docs/user-guide/rust/example/index.md | Updates quickstart example to use ? on row.get_* calls. |
| website/docs/user-guide/rust/data-types.md | Updates “Reading Row Data” example to use ? for null-check and getters. |
| website/docs/user-guide/rust/api-reference.md | Updates InternalRow method signatures to return Result<…> and adds is_null_at. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Method | Description | | ||
| |----------------------------------------------------------------------------------------|-----------------------------------------| | ||
| | `fn is_null_at(&self, idx: usize) -> Result<bool>` | Check if a field is null | | ||
| | `fn get_boolean(&self, idx: usize) -> Result<bool>` | Get boolean value | | ||
| | `fn get_byte(&self, idx: usize) -> Result<i8>` | Get tinyint value | | ||
| | `fn get_short(&self, idx: usize) -> Result<i16>` | Get smallint value | | ||
| | `fn get_int(&self, idx: usize) -> Result<i32>` | Get int value | | ||
| | `fn get_long(&self, idx: usize) -> Result<i64>` | Get bigint value | | ||
| | `fn get_float(&self, idx: usize) -> Result<f32>` | Get float value | | ||
| | `fn get_double(&self, idx: usize) -> Result<f64>` | Get double value | | ||
| | `fn get_string(&self, idx: usize) -> Result<&str>` | Get string value | | ||
| | `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | ||
| | `fn get_date(&self, idx: usize) -> Result<Date>` | Get date value | | ||
| | `fn get_time(&self, idx: usize) -> Result<Time>` | Get time value | | ||
| | `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | ||
| | `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | | ||
| | `fn get_bytes(&self, idx: usize) -> Result<&[u8]>` | Get bytes value | | ||
| | `fn get_binary(&self, idx: usize, length: usize) -> Result<&[u8]>` | Get fixed-length binary value | | ||
| | `fn get_char(&self, idx: usize, length: usize) -> Result<&str>` | Get fixed-length char value | |
There was a problem hiding this comment.
The InternalRow trait API reference table is incomplete: the actual trait also defines get_field_count(&self) -> usize and as_encoded_bytes(...) -> Option<&[u8]> (with a default impl). Either add these methods to the table or clarify in the surrounding text that this table only documents the typed field getters/null-checks.
| | Method | Description | | |
| |----------------------------------------------------------------------------------------|-----------------------------------------| | |
| | `fn is_null_at(&self, idx: usize) -> Result<bool>` | Check if a field is null | | |
| | `fn get_boolean(&self, idx: usize) -> Result<bool>` | Get boolean value | | |
| | `fn get_byte(&self, idx: usize) -> Result<i8>` | Get tinyint value | | |
| | `fn get_short(&self, idx: usize) -> Result<i16>` | Get smallint value | | |
| | `fn get_int(&self, idx: usize) -> Result<i32>` | Get int value | | |
| | `fn get_long(&self, idx: usize) -> Result<i64>` | Get bigint value | | |
| | `fn get_float(&self, idx: usize) -> Result<f32>` | Get float value | | |
| | `fn get_double(&self, idx: usize) -> Result<f64>` | Get double value | | |
| | `fn get_string(&self, idx: usize) -> Result<&str>` | Get string value | | |
| | `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | |
| | `fn get_date(&self, idx: usize) -> Result<Date>` | Get date value | | |
| | `fn get_time(&self, idx: usize) -> Result<Time>` | Get time value | | |
| | `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | |
| | `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | | |
| | `fn get_bytes(&self, idx: usize) -> Result<&[u8]>` | Get bytes value | | |
| | `fn get_binary(&self, idx: usize, length: usize) -> Result<&[u8]>` | Get fixed-length binary value | | |
| | `fn get_char(&self, idx: usize, length: usize) -> Result<&str>` | Get fixed-length char value | | |
| | Method | Description | | |
| |----------------------------------------------------------------------------------------|---------------------------------------------------| | |
| | `fn is_null_at(&self, idx: usize) -> Result<bool>` | Check if a field is null | | |
| | `fn get_boolean(&self, idx: usize) -> Result<bool>` | Get boolean value | | |
| | `fn get_byte(&self, idx: usize) -> Result<i8>` | Get tinyint value | | |
| | `fn get_short(&self, idx: usize) -> Result<i16>` | Get smallint value | | |
| | `fn get_int(&self, idx: usize) -> Result<i32>` | Get int value | | |
| | `fn get_long(&self, idx: usize) -> Result<i64>` | Get bigint value | | |
| | `fn get_float(&self, idx: usize) -> Result<f32>` | Get float value | | |
| | `fn get_double(&self, idx: usize) -> Result<f64>` | Get double value | | |
| | `fn get_string(&self, idx: usize) -> Result<&str>` | Get string value | | |
| | `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | |
| | `fn get_date(&self, idx: usize) -> Result<Date>` | Get date value | | |
| | `fn get_time(&self, idx: usize) -> Result<Time>` | Get time value | | |
| | `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | |
| | `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | | |
| | `fn get_bytes(&self, idx: usize) -> Result<&[u8]>` | Get bytes value | | |
| | `fn get_binary(&self, idx: usize, length: usize) -> Result<&[u8]>` | Get fixed-length binary value | | |
| | `fn get_char(&self, idx: usize, length: usize) -> Result<&str>` | Get fixed-length char value | | |
| | `fn get_field_count(&self) -> usize` | Get number of fields in the row | | |
| | `fn as_encoded_bytes(...) -> Option<&[u8]>` | Access underlying encoded bytes representation | |
| | `fn is_null_at(&self, idx: usize) -> Result<bool>` | Check if a field is null | | ||
| | `fn get_boolean(&self, idx: usize) -> Result<bool>` | Get boolean value | | ||
| | `fn get_byte(&self, idx: usize) -> Result<i8>` | Get tinyint value | | ||
| | `fn get_short(&self, idx: usize) -> Result<i16>` | Get smallint value | | ||
| | `fn get_int(&self, idx: usize) -> Result<i32>` | Get int value | | ||
| | `fn get_long(&self, idx: usize) -> Result<i64>` | Get bigint value | | ||
| | `fn get_float(&self, idx: usize) -> Result<f32>` | Get float value | | ||
| | `fn get_double(&self, idx: usize) -> Result<f64>` | Get double value | | ||
| | `fn get_string(&self, idx: usize) -> Result<&str>` | Get string value | | ||
| | `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | ||
| | `fn get_date(&self, idx: usize) -> Result<Date>` | Get date value | | ||
| | `fn get_time(&self, idx: usize) -> Result<Time>` | Get time value | | ||
| | `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | ||
| | `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | |
There was a problem hiding this comment.
In this table the parameter name is documented as idx, but the Rust trait uses pos (and the surrounding GenericRow methods are documented with pos). Consider switching these signatures to pos for consistency with the actual API and the rest of this page.
| | `fn is_null_at(&self, idx: usize) -> Result<bool>` | Check if a field is null | | |
| | `fn get_boolean(&self, idx: usize) -> Result<bool>` | Get boolean value | | |
| | `fn get_byte(&self, idx: usize) -> Result<i8>` | Get tinyint value | | |
| | `fn get_short(&self, idx: usize) -> Result<i16>` | Get smallint value | | |
| | `fn get_int(&self, idx: usize) -> Result<i32>` | Get int value | | |
| | `fn get_long(&self, idx: usize) -> Result<i64>` | Get bigint value | | |
| | `fn get_float(&self, idx: usize) -> Result<f32>` | Get float value | | |
| | `fn get_double(&self, idx: usize) -> Result<f64>` | Get double value | | |
| | `fn get_string(&self, idx: usize) -> Result<&str>` | Get string value | | |
| | `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | |
| | `fn get_date(&self, idx: usize) -> Result<Date>` | Get date value | | |
| | `fn get_time(&self, idx: usize) -> Result<Time>` | Get time value | | |
| | `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | |
| | `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | | |
| | `fn is_null_at(&self, pos: usize) -> Result<bool>` | Check if a field is null | | |
| | `fn get_boolean(&self, pos: usize) -> Result<bool>` | Get boolean value | | |
| | `fn get_byte(&self, pos: usize) -> Result<i8>` | Get tinyint value | | |
| | `fn get_short(&self, pos: usize) -> Result<i16>` | Get smallint value | | |
| | `fn get_int(&self, pos: usize) -> Result<i32>` | Get int value | | |
| | `fn get_long(&self, pos: usize) -> Result<i64>` | Get bigint value | | |
| | `fn get_float(&self, pos: usize) -> Result<f32>` | Get float value | | |
| | `fn get_double(&self, pos: usize) -> Result<f64>` | Get double value | | |
| | `fn get_string(&self, pos: usize) -> Result<&str>` | Get string value | | |
| | `fn get_decimal(&self, pos: usize, precision: usize, scale: usize) -> Result<Decimal>` | Get decimal value | | |
| | `fn get_date(&self, pos: usize) -> Result<Date>` | Get date value | | |
| | `fn get_time(&self, pos: usize) -> Result<Time>` | Get time value | | |
| | `fn get_timestamp_ntz(&self, pos: usize, precision: u32) -> Result<TimestampNtz>` | Get timestamp value | | |
| | `fn get_timestamp_ltz(&self, pos: usize, precision: u32) -> Result<TimestampLtz>` | Get timestamp with local timezone value | |
Brief change log
Update doc after rust / c++ panic fixes
Tests
Verified examples / api doc changes with local test