Skip to main content
Pixeltable provides a rich type system designed for multimodal AI applications. Every column and expression has an associated type that determines what data it can hold and what operations are available.

Type overview

pxt.Audio, pxt.Video, and pxt.Document return file paths when queried. Pixeltable automatically downloads and caches remote media locally. Use .fileurl to get the original URL.

Basic types

Auto-generated UUIDs

Use uuid7() to create columns that auto-generate unique identifiers:
You can also add UUIDs to existing tables:
By default, stored=True for all computed columns—values compute once and persist. For UUIDs, this ensures stable identifiers. Setting stored=False would regenerate UUIDs on every query (almost never what you want).
See the UUID cookbook for more examples of working with unique identifiers.

Media types

Pixeltable natively supports images, video, audio, and documents as first-class column types.

Image specialization

Images can be constrained by resolution and/or color mode:
See the PIL Documentation for the full list of image modes ('RGB', 'RGBA', 'L', etc.).

Array types (embeddings & tensors)

Arrays are used for embeddings, feature vectors, and tensor data. They must always specify a shape and dtype.
Array shapes follow NumPy conventions. Use None for unconstrained dimensions:
  • (512,) — fixed 512-element vector
  • (None, 768) — variable-length sequence of 768-dim vectors
  • (64, 64, 3) — fixed 64×64×3 tensor

Working with arrays

JSON type

The Json type stores flexible structured data—dictionaries, lists, or primitives.

JSON path access

Access nested data using dictionary or attribute syntax:
Pixeltable handles missing keys gracefully—you’ll get None instead of an exception.

JSON schema validation

Validate JSON columns against a schema to ensure data integrity:

Using Pydantic models

Type conversion

Use astype() to convert string file paths or URLs to media types:
Primary use case: Converting string columns containing file paths or URLs to media types (Image, Video, Audio, Document).
For other type conversions, use built-in functions from the string, json, or math modules. For example, use string.len() to get string length as an integer, or access JSON fields directly.

Column properties

Media column properties

Media columns (Image, Video, Audio, Document) have special properties:

Error properties

Computed columns have errortype and errormsg properties for debugging:

Best practices

Use Specific Types

Prefer pxt.Image[(224,224), 'RGB'] over pxt.Image when you know the constraints. This enables optimizations and catches errors early.

Validate JSON

Use JSON schema validation or Pydantic models for structured data to ensure consistency across your pipeline.

Specify Array Shapes

Always specify array shapes and dtypes. Use None for variable dimensions: pxt.Array[(None, 768), pxt.Float].

Handle Errors Gracefully

Use on_error='ignore' in production pipelines, then query .errortype and .errormsg to debug failures.

See also

Tables & Data Operations

Creating and managing tables

Computed Columns

Transform data with computed columns

SDK Reference

Complete type reference
Last modified on June 24, 2026