Data Types

DataFusion uses Arrow, and thus the Arrow type system, for query execution. The SQL types from sqlparser-rs are mapped to Arrow data types according to the following table. This mapping occurs when defining the schema in a CREATE EXTERNAL TABLE command or when performing a SQL CAST operation.

Character Types

SQL DataType

Arrow DataType

CHAR

Utf8

VARCHAR

Utf8

TEXT

Utf8

Numeric Types

SQL DataType

Arrow DataType

TINYINT

Int8

SMALLINT

Int16

INT or INTEGER

Int32

BIGINT

Int64

TINYINT UNSIGNED

UInt8

SMALLINT UNSIGNED

UInt16

INT UNSIGNED or INTEGER UNSIGNED

UInt32

BIGINT UNSIGNED

UInt64

FLOAT

Float32

REAL

Float32

DOUBLE

Float64

DECIMAL(p,s)

Decimal128(p,s)

Date/Time Types

SQL DataType

Arrow DataType

DATE

Date32

TIME

Time64(TimeUnit::Nanosecond)

TIMESTAMP

Timestamp(TimeUnit::Nanosecond, None)

Boolean Types

SQL DataType

Arrow DataType

BOOLEAN

Boolean

Binary Types

SQL DataType

Arrow DataType

BYTEA

Binary

Unsupported Types

SQL Data Type

Arrow DataType

UUID

Not yet supported

BLOB

Not yet supported

CLOB

Not yet supported

BINARY

Not yet supported

VARBINARY

Not yet supported

REGCLASS

Not yet supported

NVARCHAR

Not yet supported

STRING

Not yet supported

CUSTOM

Not yet supported

ARRAY

Not yet supported

ENUM

Not yet supported

SET

Not yet supported

INTERVAL

Not yet supported

DATETIME

Not yet supported