Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions website/docs/user-guide/rust/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,24 +375,25 @@ Implements the `InternalRow` trait (see below).

## `InternalRow` trait

| Method | Description |
|--------------------------------------------------------------------------------|-----------------------------------------|
| `fn get_boolean(&self, idx: usize) -> bool` | Get boolean value |
| `fn get_byte(&self, idx: usize) -> i8` | Get tinyint value |
| `fn get_short(&self, idx: usize) -> i16` | Get smallint value |
| `fn get_int(&self, idx: usize) -> i32` | Get int value |
| `fn get_long(&self, idx: usize) -> i64` | Get bigint value |
| `fn get_float(&self, idx: usize) -> f32` | Get float value |
| `fn get_double(&self, idx: usize) -> f64` | Get double value |
| `fn get_string(&self, idx: usize) -> &str` | Get string value |
| `fn get_decimal(&self, idx: usize, precision: usize, scale: usize) -> Decimal` | Get decimal value |
| `fn get_date(&self, idx: usize) -> Date` | Get date value |
| `fn get_time(&self, idx: usize) -> Time` | Get time value |
| `fn get_timestamp_ntz(&self, idx: usize, precision: u32) -> TimestampNtz` | Get timestamp value |
| `fn get_timestamp_ltz(&self, idx: usize, precision: u32) -> TimestampLtz` | Get timestamp with local timezone value |
| `fn get_bytes(&self, idx: usize) -> &[u8]` | Get bytes value |
| `fn get_binary(&self, idx: usize, length: usize) -> &[u8]` | Get fixed-length binary value |
| `fn get_char(&self, idx: usize, length: usize) -> &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 |
Comment on lines +380 to +393

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
| `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 |

Copilot uses AI. Check for mistakes.
| `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 |
Comment on lines +378 to +396

Copilot AI Mar 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
| 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 |

Copilot uses AI. Check for mistakes.

## `ChangeType`

Expand Down
14 changes: 7 additions & 7 deletions website/docs/user-guide/rust/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ use fluss::row::InternalRow;
for record in scan_records {
let row = record.row();

if row.is_null_at(0) {
if row.is_null_at(0)? {
// field is null
}
let id: i32 = row.get_int(0);
let name: &str = row.get_string(1);
let score: f32 = row.get_float(2);
let date: Date = row.get_date(3);
let ts: TimestampNtz = row.get_timestamp_ntz(4, 6);
let decimal: Decimal = row.get_decimal(5, 10, 2);
let id: i32 = row.get_int(0)?;
let name: &str = row.get_string(1)?;
let score: f32 = row.get_float(2)?;
let date: Date = row.get_date(3)?;
let ts: TimestampNtz = row.get_timestamp_ntz(4, 6)?;
let decimal: Decimal = row.get_decimal(5, 10, 2)?;
}
```
2 changes: 1 addition & 1 deletion website/docs/user-guide/rust/example/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async fn main() -> Result<()> {
let records = scanner.poll(Duration::from_secs(5)).await?;
for record in records {
let row = record.row();
println!("id={}, name={}", row.get_int(0), row.get_string(1));
println!("id={}, name={}", row.get_int(0)?, row.get_string(1)?);
}

Ok(())
Expand Down
10 changes: 5 additions & 5 deletions website/docs/user-guide/rust/example/log-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ for (bucket, bucket_records) in records.records_by_buckets() {
let row = record.row();
println!(
" event_id={}, event_type={} @ offset={}",
row.get_int(0),
row.get_string(1),
row.get_int(0)?,
row.get_string(1)?,
record.offset()
);
}
Expand All @@ -82,9 +82,9 @@ for record in records {
let row = record.row();
println!(
"event_id={}, event_type={}, timestamp={} @ offset={}",
row.get_int(0),
row.get_string(1),
row.get_long(2),
row.get_int(0)?,
row.get_string(1)?,
row.get_long(2)?,
record.offset()
);
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/user-guide/rust/example/partitioned-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ key.set_field(2, 1i64); // zone (partition column)

let result = lookuper.lookup(&key).await?;
if let Some(row) = result.get_single_row()? {
println!("Found: score={}", row.get_long(3));
println!("Found: score={}", row.get_long(3)?);
}
```

Expand Down
6 changes: 3 additions & 3 deletions website/docs/user-guide/rust/example/primary-key-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ let result = lookuper.lookup(&key).await?;
if let Some(row) = result.get_single_row()? {
println!(
"Found: id={}, name={}, age={}",
row.get_int(0),
row.get_string(1),
row.get_long(2)
row.get_int(0)?,
row.get_string(1)?,
row.get_long(2)?
);
} else {
println!("Record not found");
Expand Down
Loading