Skip to main content

ORC module

Apache Software Foundation

@loaders.gl/tables/orc

@loaders.gl/tables/orc reads and writes Apache ORC files. Its source API exposes metadata and a portable scan contract while keeping the current materialized execution model explicit.

ORC loader example

Hosted ORC loader

This Apache ORC compatibility fixture is fetched directly in the browser and decoded to an Apache Arrow table.

Ready

Source: Apache ORC v0 compatibility fixture.

The scan execution map

One query path. Format-specific readers.

The application describes the request once. Planning and range access stay shared while each storage format keeps its own physical decoder.

Application request

Viewport / queryColumns + filterRender target

Table planner

Snapshot selectionManifest discoveryPartition pruning

Shared scan engine

File discoveryProjectionPredicate ASTBounded tasksRange accessBatch scheduling

Format-specific readers

Parquetrow groups · pages · indexes
Avroblocks · schemas · records
ORCstripes · streams · indexes
Lance · Vortexnative storage adapters

Common analytical result

Arrow batchesZero-copy pathsApplication / GPU

Browser-native runtime

Fetch + HTTP RangeWorkers + cancellationTyped arrays

Iceberg and other table formats can plan files above the shared engine; the matching reader still owns its schema, statistics, pages, blocks, or stripes.

The ORC path

Discover the footer. Decode the file. Apply the query.

ORC source metadata supports portable query planning, while the current implementation materializes the file before residual filtering and projection. That boundary is documented rather than implied as pushdown.

Input

ORC file URL, Blob, or loaded data

Discover

Footer metadata, schema, and row count

Query

Projection, predicate, and limit

Output

Arrow batches or materialized Arrow table

Detailed guide

ORC scan and writer details

The reference below covers installation, current scan behavior, query methods, supported capabilities, and the distinction from physical stripe pushdown.

From v5.0Scan supported

The @loaders.gl/tables/orc module reads and writes Apache ORC files. ORCLoader adds a portable table scan over a URL or Blob and returns Arrow data.

Installation​

npm install @loaders.gl/core @loaders.gl/tables apache-arrow

Scan support​

The current source is a correct materialized scan. It reads ORC footer metadata for discovery, then decodes the complete file before applying the portable query. It does not claim stripe or row-index pushdown.

CapabilitySupportExecution
Entry point✅ read() or query()Arrow batch or materialized Arrow table
Schema and row-count discovery✅ SupportedORC footer metadata
Predicate✅ SupportedResidual after decoding
Projection✅ SupportedResidual
Global limit✅ SupportedResidual after filtering
Streaming and cooperative cancellation❌ Not advertisedComplete-file execution
Stripe, row-index, or range pruning❌ Not implementedNo pushdown claim is made
import {createDataSource} from '@loaders.gl/core';
import {ORCLoader} from '@loaders.gl/tables/orc';
import {parseSQLPredicate} from '@loaders.gl/core/query';

const source = await createDataSource('events.orc', [ORCLoader]);
const metadata = await source.getQueryMetadata();

for await (const batch of source.read({
predicate: parseSQLPredicate("status = 'active'"),
columns: ['id', 'status'],
limit: 100
})) {
console.log(batch.data);
}

Use Parquet when physical column and row-group pruning is a hard requirement. ORC remains useful when format compatibility matters and materializing the selected file is acceptable.

LZO decompression is supported through compress-utils 0.10.1. ORC compression chunk framing is handled in TypeScript. LZO compression is not supported.