Schema:len
methodSchema:len() -> integerColumn count.
handle6 methods
Returned by DataHandle:schema(): the data's columns, by name or by position, and its metadata. Looking a column up by name takes the same time however many columns there are.
DataHandle:schemaThe examples on this page start from:
local sales = datumhue.bytes("day,loaves\nMon,12\nTue,\n"):csv()
local schema = sales:schema()Schema:len() -> integerColumn count.
Schema:field(name: string) -> Field?Look up a field by column name.
-- nil for a column the table does not have.
local loaves = schema:field("loaves")
print(loaves:dtype(), loaves:is_nullable()) --> int64 true
print(schema:field("price")) --> nilSchema:field_at(i: integer) -> Field?Look up a field by 1-based position.
-- Positions count from 1, in column order.
print(schema:field_at(1).name, schema:field_at(3)) --> day nilSchema:fields() -> function, any, nilIterator: for i, f in s:fields() do yields (integer, Field) pairs.
for i, field in schema:fields() do
print(i, field.name, field:dtype())
endSchema:metadata() -> tableSchema-level metadata as a string->string table.
Schema:meta(key: string) -> string?A single schema-level metadata entry.