Row
type Row = Record<string, unknown>;Defined in: types/row.ts:39
A Row is the JS-native representation of one record returned by a DataFrame action. It maps column names to JavaScript values.
When Arrow IPC batches are decoded, each row is materialised as a plain object. This is intentionally kept as a simple Record type because we don’t wrap it in a class because:
- Destructuring works naturally:
const { name, age } = row; - No prototype overhead for millions of rows.
Values:
numberforIntegerType,ShortType,ByteType,FloatType,DoubleTypebigintforLongType, so the decoded type is stable per column and full 64-bit precision is preserved. Wrap inNumber(row.id)when you know the value fits in a JS safe integer. See MDN’s BigInt reference for the language semantics (no float mixing, custom JSON serialization).stringforStringTypeandDecimalType(decimals decode as fixed-point strings honoring scale, e.g."1.50"forDECIMAL(10,2), since JS has no native arbitrary-precision decimal)booleanforBooleanTypeUint8ArrayforBinaryTypeDateforDateTypeandTimestampType. Sub-millisecond precision is lost: Spark’s micro/nano timestamps truncate to ms.Map<K, V>forMapType. Preserves non-string keys, unlike a plain object. Note thatJSON.stringify(map)is"{}".objectforStructType. Nested rows recurse with the same rules.unknown[]forArrayType. Recurses with the same rules.nullfor nullable columns
For compile-time typed access, narrow with df.as<Schema>().collect(). For
runtime typed access (schema not known statically), use the row
accessor namespace.