Methods
get
pub fn get<T>(self, col: int | string): T throws IoError, ParquetError, ArrowError
[src]
pub fn get<T>(self, col: int | string): T throws IoError, ParquetError, ArrowError {
switch (let col = col.(type)) {
case int:
return try (self as _Record).get::<T>(col);
case string:
return try (self as _Record).get_by_name::<T>(col);
}
}
The cell of the column at the given index.
Or get by column name, if you present the col
argument as a string.
get
pub fn get<T>(self, col: int | string): T throws IoError, ParquetError, ArrowError
[src]
pub fn get<T>(self, col: int | string): T throws IoError, ParquetError, ArrowError {
switch (let col = col.(type)) {
case int:
return try (self as _Record).get::<T>(col);
case string:
return try (self as _Record).get_by_name::<T>(col);
}
}
The cell of the column at the given index.
Or get by column name, if you present the col
argument as a string.
The cell of the column at the given index.
Or get by column name, if you present the col
argument as a string.
nv,
use std.fs.File;
use parquet.Reader;
fn main() throws {
let f = try File.open("tests/fixtures/stocks.parquet");
let reader = try Reader.new(f);
let record = try reader.next()!;
// If the column is of type `int`, we can get the value like this:
let cell = try record.get::<int>(0);
// Or if the column is of type `string`:
let cell = try record.get::<string>(0);
// We can also get the value by column name:
let cell = try record.get::<int>("name");
}