Last Updated: 3/19/2026
SQL Data Types
Feldera supports a comprehensive set of SQL data types for building data pipelines. This reference covers all supported types, their syntax, and usage examples.
Numeric Types
Integers
Feldera supports signed and unsigned integers of various sizes:
TINYINTβ 8-bit signed integer (-128 to 127)SMALLINTβ 16-bit signed integer (-32,768 to 32,767)INTEGERorINTβ 32-bit signed integerBIGINTβ 64-bit signed integer
Unsigned variants (not standard SQL):
TINYINT UNSIGNEDβ 8-bit unsigned (0 to 255)SMALLINT UNSIGNEDβ 16-bit unsignedINTEGER UNSIGNEDβ 32-bit unsignedBIGINT UNSIGNEDβ 64-bit unsigned
CREATE TABLE numbers (
tiny TINYINT,
small SMALLINT,
regular INTEGER,
big BIGINT,
unsigned_val INTEGER UNSIGNED
);Decimal Types
Fixed-precision decimal numbers:
DECIMAL(precision, scale)β Fixed-point decimalNUMERIC(precision, scale)β Alias for DECIMAL
CREATE TABLE financial (
price DECIMAL(10, 2), -- Up to 99,999,999.99
rate DECIMAL(5, 4), -- Up to 9.9999
amount NUMERIC(18, 6)
);Floating-Point Types
Approximate numeric types:
REALorFLOATβ 32-bit floating-point (F32)DOUBLEorDOUBLE PRECISIONβ 64-bit floating-point (F64)
CREATE TABLE measurements (
temperature REAL,
distance DOUBLE
);String Types
Character Strings
CHAR(n)β Fixed-length character stringVARCHAR(n)β Variable-length character stringVARCHARβ Variable-length string (no explicit limit)
CREATE TABLE users (
code CHAR(5), -- Always 5 characters
name VARCHAR(100), -- Up to 100 characters
description VARCHAR -- Unlimited length
);Binary Strings
BINARY(n)β Fixed-length binary dataVARBINARY(n)β Variable-length binary dataVARBINARYβ Variable-length binary (no explicit limit)
CREATE TABLE files (
hash BINARY(32), -- 32-byte hash
data VARBINARY
);Date and Time Types
Date
DATEβ Calendar date (year, month, day)
CREATE TABLE events (
event_date DATE
);
INSERT INTO events VALUES (DATE '2024-01-15');Time
TIMEβ Time of day without timezoneTIME(precision)β Time with fractional seconds precision
CREATE TABLE schedule (
start_time TIME,
precise_time TIME(6) -- Microsecond precision
);Timestamp
TIMESTAMPβ Date and time without timezoneTIMESTAMP(precision)β Timestamp with fractional seconds precision
CREATE TABLE logs (
created_at TIMESTAMP,
precise_ts TIMESTAMP(6)
);
INSERT INTO logs VALUES (TIMESTAMP '2024-01-15 14:30:00');Intervals
INTERVALβ Time duration
SELECT
event_time + INTERVAL 1 HOUR as one_hour_later,
event_time - INTERVAL 30 DAY as thirty_days_ago
FROM events;Interval units: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
Boolean Type
BOOLEANβ True or false value
CREATE TABLE flags (
is_active BOOLEAN,
is_deleted BOOLEAN
);
INSERT INTO flags VALUES (TRUE, FALSE);Complex Types
Arrays
Arrays of any supported type:
CREATE TABLE data (
tags ARRAY<VARCHAR>,
scores ARRAY<INTEGER>,
matrix ARRAY<ARRAY<DOUBLE>> -- Nested arrays
);
INSERT INTO data VALUES (
ARRAY['tag1', 'tag2'],
ARRAY[1, 2, 3],
ARRAY[ARRAY[1.0, 2.0], ARRAY[3.0, 4.0]]
);Array operations:
ARRAY[1, 2, 3]β Array literalarr[1]β Array indexing (1-based)CARDINALITY(arr)β Array length
Maps
Key-value mappings:
CREATE TABLE metadata (
properties MAP<VARCHAR, VARCHAR>,
counters MAP<VARCHAR, INTEGER>
);
INSERT INTO metadata VALUES (
MAP['key1', 'value1', 'key2', 'value2'],
MAP['count1', 10, 'count2', 20]
);Map operations:
MAP['k1', 'v1', 'k2', 'v2']β Map literalm['key']β Map lookupCARDINALITY(m)β Number of entries
Structs (Records)
Composite types with named fields:
CREATE TABLE locations (
point STRUCT<x DOUBLE, y DOUBLE>,
address STRUCT<
street VARCHAR,
city VARCHAR,
zip VARCHAR(10)
>
);
INSERT INTO locations VALUES (
ROW(10.5, 20.3),
ROW('123 Main St', 'Springfield', '12345')
);Struct field access:
point.xβ Field accessROW(1, 'a')β Struct literal
Special Types
UUID
Universally unique identifiers:
CREATE TABLE entities (
id UUID PRIMARY KEY
);Variant (JSON)
Dynamic JSON-like values:
CREATE TABLE documents (
data VARIANT
);NULL Values
All types can be nullable by default. Use NOT NULL to require a value:
CREATE TABLE users (
id INTEGER NOT NULL,
name VARCHAR NOT NULL,
email VARCHAR, -- Nullable
age INTEGER -- Nullable
);Type Casting
Explicit type conversion:
SELECT
CAST('123' AS INTEGER),
CAST(123.45 AS VARCHAR),
CAST('2024-01-15' AS DATE)
FROM events;Implicit casting occurs in many contexts (e.g., INTEGER to BIGINT).
Default Values
Specify default values for columns:
CREATE TABLE orders (
id INTEGER NOT NULL,
status VARCHAR DEFAULT 'pending',
created_at TIMESTAMP DEFAULT NOW()
);Type Aliases
Common type aliases:
INT=INTEGERFLOAT=REALDOUBLE PRECISION=DOUBLENUMERIC=DECIMAL
Whatβs Next
- Materialized Views: Learn how to use these types in views
- Sql Udfs: Write user-defined functions with these types
- Ad Hoc Queries: Query data with type-aware operations