Implementation:ArroyoSystems Arroyo Preview Connector
| Knowledge Sources | |
|---|---|
| Domains | Streaming, Connectors |
| Last Updated | 2026-02-08 08:00 GMT |
Overview
PreviewConnector is a hidden sink-only connector that sends pipeline output to the Arroyo web console for real-time query result preview.
Description
The Preview connector is a special internal connector (hidden: true) that cannot be created directly in SQL (from_options returns an error). It is constructed programmatically via from_config and is used by the Arroyo web UI to display live query results in the console preview pane. The connector has EmptyConfig for both profile and table types, and the make_operator method constructs a default PreviewSink operator. It requires a schema to be provided (no custom schemas supported) and propagates bad_data, framing, and metadata_fields from the schema configuration.
Usage
PreviewConnector is used internally by the Arroyo web console for live query result preview and cannot be instantiated directly from SQL queries.
Code Reference
Source Location
- Repository: ArroyoSystems_Arroyo
- File: crates/arroyo-connectors/src/preview/mod.rs
Signature
pub struct PreviewConnector {}
impl Connector for PreviewConnector {
type ProfileT = EmptyConfig;
type TableT = EmptyConfig;
fn name(&self) -> &'static str; // returns "preview"
fn table_type(&self, _: EmptyConfig, _: EmptyConfig) -> ConnectionType; // always Sink
fn from_options(&self, ...) -> anyhow::Result<Connection>; // always errors
fn from_config(&self, id: Option<i64>, name: &str, config: EmptyConfig,
table: EmptyConfig, schema: Option<&ConnectionSchema>) -> anyhow::Result<Connection>;
fn make_operator(&self, _: EmptyConfig, _: EmptyConfig,
_: OperatorConfig) -> anyhow::Result<ConstructedOperator>;
}
Import
use arroyo_connectors::preview::PreviewConnector;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| schema | ConnectionSchema | Yes | Schema for the data to preview |
Outputs
| Name | Type | Description |
|---|---|---|
| preview data | Console output | Data displayed in the Arroyo web console preview pane |
Usage Examples
// PreviewConnector is used internally by the Arroyo web UI
// It cannot be created via SQL - from_options always returns an error
let connector = PreviewConnector {};
let connection = connector.from_config(
None,
"preview_sink",
EmptyConfig {},
EmptyConfig {},
Some(&schema),
)?;