Types
info
This page is aligned to Apache Arrow JS v21.x (apache-arrow).
Arrow DataType classes describe logical column types. You compose schemas, builders, and vectors from these types.
Usage
import {Int32, Utf8, Struct, Field, Schema} from 'apache-arrow';
const schema = new Schema([
new Field('id', new Int32(), false),
new Field('name', new Utf8(), true)
]);
import {DataType} from 'apache-arrow';
console.log(DataType.isInt(new Int32()));
Core type families
Null and boolean
NullBool
Integer
IntInt8Int16Int32Int64Uint8Uint16Uint32Uint64
Floating point
FloatFloat16Float32Float64
Binary and text
BinaryLargeBinaryUtf8LargeUtf8FixedSizeBinary
Temporal
Date_DateDayDateMillisecondTimeTimeSecondTimeMillisecondTimeMicrosecondTimeNanosecondTimestampTimestampSecondTimestampMillisecondTimestampMicrosecondTimestampNanosecond
Decimal
Decimal
Nested
ListFixedSizeListStructMap_UnionSparseUnionDenseUnion
Dictionary and intervals
DictionaryDurationDurationSecondDurationMillisecondDurationMicrosecondDurationNanosecondIntervalIntervalDayTimeIntervalYearMonth
Static type checks
DataType exports runtime type guards with typed boolean outcomes:
DataType.isInt(x: unknown): x is IntDataType.isFloat(x: unknown): x is FloatDataType.isUtf8(x: unknown): x is Utf8DataType.isList(x: unknown): x is ListDataType.isStruct(x: unknown): x is StructDataType.isDictionary(x: unknown): x is Dictionary
Migration notes
Older docs and examples frequently use type-specific vector names (for example Int32Vector).
In Apache Arrow JS v21, those are not the primary exported public classes; use:
new Int32()/new Utf8()to describe schema-level typesmakeVector/vectorFromArrayto build vectorsSchema,Field, andTablefor structured data assembly