# velox-foundation/velox architecture

> Architecture diagram of the GitHub repository velox-foundation/velox, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/velox-foundation/velox
- Repository: https://github.com/velox-foundation/velox

## Overview

Velox is a composable C++ analytical execution library, not an end-user SQL engine: an integrating engine supplies an optimized plan, Velox executes it over columnar vectors and returns results. The graph preserves the documented expression, function, operator, connector/I/O, serialization, and resource-management capabilities. Some links reflect README-level architecture rather than inspected call sites; unsampled subsystem internals are represented by their exact directories, and the fuzzer modules are supporting components rather than the primary query path.

Main entry points: [`velox/exec/Task.h`](https://github.com/velox-foundation/velox/blob/main/velox/exec/Task.h) (Task Execution), [`velox/exec`](https://github.com/velox-foundation/velox/tree/main/velox/exec) (Relational Operators), [`velox/core/PlanNode.h`](https://github.com/velox-foundation/velox/blob/main/velox/core/PlanNode.h) (Plan Nodes), [`velox/connectors/hive`](https://github.com/velox-foundation/velox/tree/main/velox/connectors/hive) (Hive Connector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plan["Query Planning"]
  node_plan_nodes["Plan Nodes<br/>[PlanNode.h]"]
  node_query_config["Query Configuration<br/>[QueryConfig.h]"]
end

subgraph group_compute["Vectorized Compute"]
  node_types["Type System"]
  node_vectors["Columnar Vectors"]
  node_decoded["Decoded Vectors<br/>[DecodedVector.h]"]
  node_expressions["Expression Evaluation"]
  node_functions["Scalar and Aggregate Functions"]
end

subgraph group_io["Connectors and I/O"]
  node_hive["Hive Connector"]
  node_paimon["Paimon Connector"]
  node_file_formats["File Formats"]
  node_storage["Storage Adapters"]
  node_serializers["Network Serializers"]
end

subgraph group_runtime["Execution Runtime"]
  node_operators["Relational Operators"]
  node_task["Task Execution<br/>[Task.h]"]
  node_output_buffers["Output Buffers"]
  node_fuzzer["Query Fuzzing Support<br/>[FuzzerUtil.h]"]
  node_presto_sql["Presto Query Runner"]
end

subgraph group_resources["Resource Management"]
  node_memory["Memory Management<br/>[Memory.h]"]
  node_cache[("Data Cache<br/>[AsyncDataCache.h]")]
  node_admission["Admission Control"]
end

node_engine(("Integrating Engine"))
node_consumer(("Result Consumer"))
node_external_data[("External Data")]

node_engine -->|"supplies plan"| node_plan_nodes
node_engine -.->|"sets options"| node_query_config
node_plan_nodes -->|"drives execution"| node_task
node_task -->|"runs operators"| node_operators
node_operators -->|"processes vectors"| node_vectors
node_operators -->|"evaluates expressions"| node_expressions
node_expressions -->|"invokes functions"| node_functions
node_vectors -->|"uses types"| node_types
node_decoded -->|"decodes vectors"| node_vectors
node_operators -.->|"reads and writes"| node_hive
node_operators -.->|"reads data"| node_paimon
node_hive -->|"uses formats"| node_file_formats
node_hive -->|"uses adapters"| node_storage
node_file_formats -->|"reads and writes"| node_external_data
node_storage -->|"accesses data"| node_external_data
node_task -->|"allocates through"| node_memory
node_task -.->|"uses cache"| node_cache
node_task -.->|"limits resources"| node_admission
node_task -->|"serializes output"| node_serializers
node_task -.->|"buffers output"| node_output_buffers
node_output_buffers -.->|"serves results"| node_consumer
node_consumer -.->|"returns results"| node_engine
node_fuzzer -->|"builds test plans"| node_plan_nodes
node_presto_sql -->|"constructs query plans"| node_plan_nodes

click node_plan_nodes "https://github.com/velox-foundation/velox/blob/main/velox/core/PlanNode.h"
click node_query_config "https://github.com/velox-foundation/velox/blob/main/velox/core/QueryConfig.h"
click node_types "https://github.com/velox-foundation/velox/tree/main/velox/type"
click node_vectors "https://github.com/velox-foundation/velox/tree/main/velox/vector"
click node_decoded "https://github.com/velox-foundation/velox/blob/main/velox/vector/DecodedVector.h"
click node_expressions "https://github.com/velox-foundation/velox/tree/main/velox/expression"
click node_functions "https://github.com/velox-foundation/velox/tree/main/velox/functions"
click node_operators "https://github.com/velox-foundation/velox/tree/main/velox/exec"
click node_task "https://github.com/velox-foundation/velox/blob/main/velox/exec/Task.h"
click node_hive "https://github.com/velox-foundation/velox/tree/main/velox/connectors/hive"
click node_paimon "https://github.com/velox-foundation/velox/tree/main/velox/connectors/paimon"
click node_file_formats "https://github.com/velox-foundation/velox/tree/main/velox/dwio"
click node_storage "https://github.com/velox-foundation/velox/tree/main/velox/connectors/hive/storage_adapters"
click node_serializers "https://github.com/velox-foundation/velox/tree/main/velox/serializers"
click node_output_buffers "https://github.com/velox-foundation/velox/blob/main/velox/exec/DefaultOutputBufferManager.cpp"
click node_memory "https://github.com/velox-foundation/velox/blob/main/velox/common/memory/Memory.h"
click node_cache "https://github.com/velox-foundation/velox/blob/main/velox/common/caching/AsyncDataCache.h"
click node_admission "https://github.com/velox-foundation/velox/blob/main/velox/common/base/AdmissionController.cpp"
click node_fuzzer "https://github.com/velox-foundation/velox/blob/main/velox/exec/fuzzer/FuzzerUtil.h"
click node_presto_sql "https://github.com/velox-foundation/velox/blob/main/velox/exec/fuzzer/PrestoQueryRunner.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plan_nodes,node_query_config toneBlue
class node_types,node_vectors,node_decoded,node_expressions,node_functions,node_external_data toneAmber
class node_hive,node_paimon,node_file_formats,node_storage,node_serializers toneMint
class node_operators,node_task,node_output_buffers,node_fuzzer,node_presto_sql toneRose
class node_memory,node_cache,node_admission,node_engine,node_consumer toneIndigo
```

## Components

### Query Planning

- [Plan Nodes](https://github.com/velox-foundation/velox/blob/main/velox/core/PlanNode.h): `velox/core/PlanNode.h`
- [Query Configuration](https://github.com/velox-foundation/velox/blob/main/velox/core/QueryConfig.h): `velox/core/QueryConfig.h`

### Vectorized Compute

- [Type System](https://github.com/velox-foundation/velox/tree/main/velox/type): `velox/type`
- [Columnar Vectors](https://github.com/velox-foundation/velox/tree/main/velox/vector): `velox/vector`
- [Decoded Vectors](https://github.com/velox-foundation/velox/blob/main/velox/vector/DecodedVector.h): `velox/vector/DecodedVector.h`
- [Expression Evaluation](https://github.com/velox-foundation/velox/tree/main/velox/expression): `velox/expression`
- [Scalar and Aggregate Functions](https://github.com/velox-foundation/velox/tree/main/velox/functions): `velox/functions`

### Connectors and I/O

- [Hive Connector](https://github.com/velox-foundation/velox/tree/main/velox/connectors/hive): `velox/connectors/hive`
- [Paimon Connector](https://github.com/velox-foundation/velox/tree/main/velox/connectors/paimon): `velox/connectors/paimon`
- [File Formats](https://github.com/velox-foundation/velox/tree/main/velox/dwio): `velox/dwio`
- [Storage Adapters](https://github.com/velox-foundation/velox/tree/main/velox/connectors/hive/storage_adapters): `velox/connectors/hive/storage_adapters`
- [Network Serializers](https://github.com/velox-foundation/velox/tree/main/velox/serializers): `velox/serializers`

### Execution Runtime

- [Relational Operators](https://github.com/velox-foundation/velox/tree/main/velox/exec): `velox/exec`
- [Task Execution](https://github.com/velox-foundation/velox/blob/main/velox/exec/Task.h): `velox/exec/Task.h`
- [Output Buffers](https://github.com/velox-foundation/velox/blob/main/velox/exec/DefaultOutputBufferManager.cpp): `velox/exec/DefaultOutputBufferManager.cpp`
- [Query Fuzzing Support](https://github.com/velox-foundation/velox/blob/main/velox/exec/fuzzer/FuzzerUtil.h): `velox/exec/fuzzer/FuzzerUtil.h`
- [Presto Query Runner](https://github.com/velox-foundation/velox/blob/main/velox/exec/fuzzer/PrestoQueryRunner.cpp): `velox/exec/fuzzer/PrestoQueryRunner.cpp`

### Resource Management

- [Memory Management](https://github.com/velox-foundation/velox/blob/main/velox/common/memory/Memory.h): `velox/common/memory/Memory.h`
- [Data Cache](https://github.com/velox-foundation/velox/blob/main/velox/common/caching/AsyncDataCache.h): `velox/common/caching/AsyncDataCache.h`
- [Admission Control](https://github.com/velox-foundation/velox/blob/main/velox/common/base/AdmissionController.cpp): `velox/common/base/AdmissionController.cpp`

### Other components

- **Integrating Engine**
- **Result Consumer**
- **External Data**

## Connections

- Integrating Engine → Plan Nodes: supplies plan
- Integrating Engine → Query Configuration: sets options
- Plan Nodes → Task Execution: drives execution
- Task Execution → Relational Operators: runs operators (evidence: `velox/exec/DefaultOutputBufferManager.cpp`)
- Relational Operators → Columnar Vectors: processes vectors (evidence: `velox/exec/fuzzer/PrestoQueryRunner.cpp`)
- Relational Operators → Expression Evaluation: evaluates expressions
- Expression Evaluation → Scalar and Aggregate Functions: invokes functions
- Columnar Vectors → Type System: uses types (evidence: `velox/vector/DecodedVector.h`)
- Decoded Vectors → Columnar Vectors: decodes vectors (evidence: `velox/dwio/nimble/writer/DecodedVectorManager.h`)
- Relational Operators → Hive Connector: reads and writes (evidence: `velox/exec/fuzzer/PrestoQueryRunner.cpp`)
- Relational Operators → Paimon Connector: reads data
- Hive Connector → File Formats: uses formats
- Hive Connector → Storage Adapters: uses adapters (evidence: `velox/connectors/hive/storage_adapters/abfs/AzureClientProviderImpl.cpp`)
- File Formats → External Data: reads and writes
- Storage Adapters → External Data: accesses data
- Task Execution → Memory Management: allocates through
- Task Execution → Data Cache: uses cache
- Task Execution → Admission Control: limits resources
- Task Execution → Network Serializers: serializes output
- Task Execution → Output Buffers: buffers output (evidence: `velox/exec/DefaultOutputBufferManager.cpp`)
- Output Buffers → Result Consumer: serves results
- Result Consumer → Integrating Engine: returns results
- Query Fuzzing Support → Plan Nodes: builds test plans (evidence: `velox/exec/fuzzer/FuzzerUtil.h`)
- Presto Query Runner → Plan Nodes: constructs query plans
