Important
Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.
Connector Pipelines
On this page
Note
This is a Preview feature.
Overview
SingleStore Connector Pipelines can use Kafka Connect source connectors to stream data from external systems into SingleStore.
Key Concepts
The Kafka Connect framework is an open-source component of Apache Kafka that provides a scalable and reliable method to stream data between systems.
-
Source connectors: Pull data from external systems into Kafka
-
Sink connectors: Push data from Kafka to external systems
SingleStore uses Kafka Connect source connectors to ingest data directly into SingleStore tables without requiring an intermediate Kafka cluster.
Architecture
Key Architectural Features
-
Leaf Node Processing: The extractor processes data on leaf nodes rather than the Master Aggregator which reduces load on the aggregator and improves performance.
-
Static Schema Table: By default, when output.
value. field is not specified, records are loaded into a three-column table with value(JSON),timestamp(BIGINT), andtopic(TEXT).When you specify an output mode, the inferred table instead matches the payload schema. Refer to Output Modes for more information. -
JSON-Based Offset Management: Uses
information_table to track offsets in JSON format that supports complex offset structures required by different connectors.schema. PIPELINES_ SOURCE_ OFFSETS -
Multi-Task Support: Pipelines can spawn multiple tasks for parallel processing when the data source supports partitioning (for example, Kinesis shards).
Static Schema Table
The extractor produces structured records containing three groups of fields: the user payload, connector-specific metadata (for example, Kinesis shard ID or Pub/Sub message key), and Kafka Connect framework metadata (topic, timestamp, key, headers, sourcePartition, sourceOffset).FORMAT JSON mode emits the full record as JSON; use an output mode to project only the payload or to merge the payload with selected metadata fields.
How Connector Pipelines Works
When a Connector pipeline is created, SingleStore performs the following:
-
Checks the connector class and configuration parameters
-
If using
CREATE INFERRED PIPELINE, automatically creates an inferred table with the static schema -
Launches the extractor process on leaf nodes
-
Ingests data from the external data source and loads data into the table
-
Stores offset information in
PIPELINES_to provide at-least-once delivery.SOURCE_ OFFSETS To achieve exactly-once results, define a unique key on the target table and use IGNORE DUPLICATE KEY ERRORSorON DUPLICATE KEY UPDATEto handle replayed records.
Deploy Kafka Connect Connectors
Kinesis and Pub/Sub connectors are prepackaged and updated as part of database upgrades.
The following are the supported source connectors:
|
Connector |
Full class name |
Short name |
|---|---|---|
|
|
| |
|
|
|
Enable Connector Pipelines
Connector Pipelines is an experimental feature that must be explicitly enabled.
SET GLOBAL experimental_features_config = "connector_pipelines_enabled=true"
Note
This setting must be configured before creating Connector Pipelines and requires the SUPER permission.
Run the following command to confirm whether this feature is enabled.
SHOW VARIABLES LIKE 'experimental_features_config'
+------------------------------+-------------------------------------------------------+
| Variable_name | Value |
+------------------------------+-------------------------------------------------------+
| experimental_features_config | connector_pipelines_enabled=true |
+------------------------------+-------------------------------------------------------+After enabling the Connector Pipelines, start the Kafka Connect source connector manually using the provided configuration.
Syntax
CREATE [OR REPLACE] [INFERRED] PIPELINE <pipeline_name>AS LOAD DATA CONNECTOR '<connector>'CONFIG '<connector_configuration_json>'CREDENTIALS '<credentials_json>'[BATCH_INTERVAL <milliseconds>][DISABLE OUT_OF_ORDER OPTIMIZATION][DISABLE OFFSETS METADATA GC]INTO { TABLE <table_name> | PROCEDURE <procedure_name> }[FORMAT { JSON | AVRO }][( <field_mapping>, ... )];
The first string after LOAD DATA CONNECTOR identifies the connector class.
-
Full class name:
com.singlestore. kafka. connect. kinesis. KinesisSourceConnector -
Short name:
KinesisSourceConnector(class name without the package) -
Pruned name:
KinesisSource(short name without the Connector suffix)
Short and pruned names require the connector JAR to include ServiceLoader metadata that is compatible with KIP-898.
Use INTO TABLE to load extracted records directly into a table.INTO PROCEDURE to route each batch through a stored procedure for transformation, enrichment, or fan-out to multiple tables.QUERY variable whose columns match the extractor's output for the selected format and enabled output. fields.
Loading INTO PROCEDURE can reduce ingestion throughput compared to INTO TABLE.INTO PROCEDURE only when the transformation cannot be expressed as a SET clause or column mapping.
CONFIG Parameter
The CONFIG parameter must contain a JSON object.CONFIG are connector-specific except for the following framework-level options:
|
Option |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
|
Maximum number of tasks the connector spawns for parallel extraction. |
|
|
|
|
Include the connector's value structure in the output. |
|
|
|
|
Include the record timestamp ( |
|
|
|
|
Include the internal topic identifier. |
|
|
|
|
Include the record key. |
|
|
|
|
Include Kafka Connect headers. |
|
|
|
|
Include the source partition object. |
|
|
|
|
Include the source offset object. |
|
|
|
— |
Enable single-value output mode. |
|
|
|
— |
Enable merge output mode. |
|
|
|
— |
Required in |
|
|
|
— |
Required in |
Note
Place sensitive fields, such as access keys, secrets, tokens, and service account JSON, in the CREDENTIALS clause rather than CONFIG.CREDENTIALS are redacted in SHOW CREATE PIPELINE, while values in CONFIG are stored and displayed in cleartext.
Refer to CREATE PIPELINE and CREATE INFERRED PIPELINE for more information.
Output Modes
Each connector produces a Kafka Connect SourceRecord with top-level fields (key, value, timestamp, topic) and connector-specific data inside value.
-
Amazon Kinesis wraps the payload with metadata.
value.contains the raw payload bytes;data value.,partitionKey value.,shardId value., etc.sequenceNumber are Kinesis metadata. Amazon Kinesis produces a
SourceRecordwith the following structure:{"topic": "kinesis-ingest","timestamp": 1787208784705,"key": "key-1","value": {"data": "<payload bytes, base64 in JSON mode>","partitionKey": "key-1","sequenceNumber": "49653543268136818...","shardId": "shardId-000000000000","streamName": "my-stream","approximateArrivalTimestamp": 1787208784705}} -
Google Cloud Pub/Sub exposes the payload directly.
valueis the payload.Google Cloud Pub/Sub produces a
SourceRecordwith the following structure:{"topic": "s2-pubsub","timestamp": 1787212384000,"key": null,"value": "<payload bytes>"} -
Default output: Without an output mode, the pipeline delivers the full record.
The user payload is base64-encoded in JSON mode, or in a BLOBcolumn in Avro mode.To extract at query time you would need FROM_.BASE64(JSON_ EXTRACT_ STRING(value, 'data')) Use one of the following output modes instead. For example, a Kinesis pipeline in
FORMAT JSONwith no output mode delivers records in the following format:{"value": {"data": "eyJpZCI6IDEsICJldmVudCI6ICJvcmRlcl9wbGFjZWQiLCAiYW1vdW50IjogOTkuOTV9","partitionKey": "key-1","shardId": "shardId-000000000000","sequenceNumber": "49653543268136818..."},"timestamp": 1787208784705,"topic": "kinesis-ingest"}To read the payload, use
FROM_andBASE64 JSON_together.EXTRACT_ STRING An output mode performs this decoding automatically. -
Single-value output mode (
output.): Extracts the payload and outputs it directly.value. field The inferred table matches the payload schema. Amazon Kinesis:
CREATE INFERRED PIPELINE kinesis_ordersAS LOAD DATA CONNECTOR 'com.singlestore.kafka.connect.kinesis.KinesisSourceConnector'CONFIG '{"kafka.topic": "orders-topic","kinesis.stream": "orders-stream","kinesis.region": "us-east-1","tasks.max": "3","output.value.field": "data"}'CREDENTIALS '{"aws.access.key.id": "<ACCESS_KEY>","aws.secret.access.key": "<SECRET_KEY>"}'FORMAT JSON;Pub/Sub (payload is
value, sooutput.isvalue. field ""):CREATE INFERRED PIPELINE pubsub_eventsAS LOAD DATA CONNECTOR 'com.google.pubsub.kafka.source.CloudPubSubSourceConnector'CONFIG '{"kafka.topic": "s2-events","tasks.max": "1","cps.project": "my-gcp-project","cps.subscription": "events-sub","output.value.field": ""}'CREDENTIALS '{ "gcp.credentials.json": "<SERVICE_ACCOUNT_JSON>" }'FORMAT JSON; -
Merge output mode (
output.): Decodes the payload and exposes it alongside the metadata fields, so both can be mapped to columns.value. merge Amazon Kinesis:
CREATE TABLE kinesis_events (ingested_at BIGINT,shard TEXT,payload JSON);CREATE PIPELINE kinesis_merge_pipeAS LOAD DATA CONNECTOR 'com.singlestore.kafka.connect.kinesis.KinesisSourceConnector'CONFIG '{"kafka.topic": "orders-topic","kinesis.stream": "orders-stream","kinesis.region": "us-east-1","tasks.max": "3","output.value.merge": "data","output.value": "true","output.timestamp": "true","output.key": "false","output.topic": "false"}'CREDENTIALS '{ "aws.access.key.id": "<ACCESS_KEY>", "aws.secret.access.key": "<SECRET_KEY>" }'INTO TABLE kinesis_eventsFORMAT JSON(`ingested_at` <- `timestamp`, `shard` <- `value`::`shardId`, `payload` <- `value`::`data`);Google Cloud Pub/Sub:
CREATE TABLE pubsub_events_merge (ingested_at BIGINT,payload JSON);CREATE PIPELINE pubsub_merge_pipeAS LOAD DATA CONNECTOR 'com.google.pubsub.kafka.source.CloudPubSubSourceConnector'CONFIG '{"kafka.topic": "s2-events","tasks.max": "1","cps.project": "my-gcp-project","cps.subscription": "events-sub","output.value.merge": "","output.value": "true","output.timestamp": "true","output.topic": "false"}'CREDENTIALS '{ "gcp.credentials.json": "<SERVICE_ACCOUNT_JSON>" }'INTO TABLE pubsub_events_mergeFORMAT JSON(`ingested_at` <- `timestamp`, `payload` <- `value`);
-
-
Avro output mode (
FORMAT AVRO): Produces an Avro record collection with the same three-group structure as JSON mode: user payload, connector metadata, and framework metadata.Avro mode has the following requirements: -
The source connector must emit records with a consistent schema.
-
Specify
output.invalue. schema CONFIG. -
If
output.iskey true, also specifyoutput.inkey. schema CONFIG. -
The pipeline fails the batch if the extractor encounters a record with an unexpected schema.
For
KinesisSourceConnector, add the following fields toCONFIG:{"output.key.schema": "com.singlestore.kafka.connect.kinesis.KinesisKey","output.value.schema": "com.singlestore.kafka.connect.kinesis.KinesisValue"}Avro supports byte arrays natively, so binary fields are not base64-encoded, unlike in JSON mode.
-
Select an output mode:
|
Requirement |
Mode |
Configuration |
|---|---|---|
|
Load data as typed columns |
Single-value |
|
|
Load data with connector or framework metadata |
Merge |
|
|
Load the full connector record |
Default (no output mode) |
No output mode configuration |
Column mapping syntax.:: to project nested fields:
(`ingested_at` <- `timestamp`,`payload` <- `value`::`data`,`partition_key` <- `value`::`partitionKey`,`shard_id` <- `value`::`shardId`)
For deeper access from a SET clause, bind the source field to a variable first (JSON built-ins accept only string literals as paths):
FORMAT JSON(@raw_payload <- `value`::`data`)SETorder_id = JSON_EXTRACT_STRING(@raw_payload, 'id'),amount = JSON_EXTRACT_DOUBLE(@raw_payload, 'amount');
Connector Configuration Reference
The following tables describe the connector-specific CONFIG and CREDENTIALS fields for the supported source connectors.
Amazon Kinesis
CONFIG Fields
|
Field |
Description |
|---|---|
|
|
Internal topic identifier (any value; not a real Kafka topic). |
|
|
Amazon Kinesis Data Stream name. |
|
|
AWS region containing the stream (for example, |
|
|
Number of parallel extraction tasks. |
CREDENTIALS Fields
|
Field |
Description |
|---|---|
|
|
AWS access key ID. |
|
|
AWS secret access key. |
|
|
(Optional) AWS session token when using temporary credentials. |
Note
Place AWS credentials in the CREDENTIALS clause.CREDENTIALS are redacted in SHOW CREATE PIPELINE.
Google Cloud Pub/Sub
CONFIG Fields
|
Field |
Description |
|---|---|
|
|
Internal topic identifier (any value). |
|
|
Google Cloud project ID that contains the Pub/Sub subscription. |
|
|
Pub/Sub subscription name. |
|
|
Must be |
CREDENTIALS Fields
|
Field |
Description |
|---|---|
|
|
Google Cloud service account key JSON. |
Offset Management
View Offsets
Connector Pipelines use JSON-based offsets stored in information_, which differs from traditional integer-based offsets used by native Kafka pipelines.
SELECT * FROM information_schema.PIPELINES_SOURCE_OFFSETSWHERE PIPELINE_NAME = 'connector-pipeline'
Offset Format Examples
The following is the format of KEY and VALUE of Amazon Kinesis offsets:
KEY: {"shardId":"shardId-XXXX"}VALUE: {"sequenceNumber":"XXXX"}
Amazon Kinesis:
SOURCE_PARTITION_KEY: {"shardId":"shardId-000000000000"}EARLIEST_OFFSET / LATEST_OFFSET: {"sequenceNumber":"49674719724351887279438853487463363258610716483094839298"}
The following is the format of KEY and VALUE of Google Cloud Pub/Sub offsets:
KEY: NULLVALUE: {"projects/<gcp-project>/subscriptions/<subscription>":"<sequence>"}
Google Cloud Pub/Sub:
For example, a pipeline might have the following offset information:
DATABASE_NAME: test_dbPIPELINE_NAME: sir_vennBATCH_ID: 40080TASK_ID: 0KEY: NULLVALUE: {"projects/singlestore-private/subscriptions/sir_venn_sub":"29"}
Set Offsets
Use ALTER PIPELINE … SET OFFSETS to move a Connector Pipeline to a different starting position, for example, to replay from the earliest available record or to resume from a specific per-partition offset captured earlier.
ALTER PIPELINE <pipeline_name> SET OFFSETS { EARLIEST | LATEST | '<json_source_partition_offset>' };
-
EARLIEST: Starts from the oldest record available in each source partition. -
LATEST: Skips existing records and starts from the tail. -
'<json_: Specifies a JSON array ofsource_ partition_ offset>' { "task_entries, one per source partition.id", "key", "value" } The key and value shapes match the KEYandVALUEcolumns ininformation_.schema. PIPELINES_ SOURCE_ OFFSETS
Amazon Kinesis:
ALTER PIPELINE kinesis_pipe SET OFFSETS'[{"task_id": 0,"key": {"shardId": "shardId-000000000000"},"value": {"sequenceNumber": "49673435375909482348849496489467527403761012818415976450"}},{"task_id": 1,"key": {"shardId": "shardId-000000000001"},"value": {"sequenceNumber": "49673435375931783094048027112609063122033660698885619730"}}]';
Google Cloud Pub/Sub: Pub/Sub offsets use NULL for KEY:
ALTER PIPELINE pubsub_pipe SET OFFSETS'[{"task_id": 0,"key": null,"value": {"projects/singlestore-private/subscriptions/sir_venn_sub": "29"}}]';
To replay all records from the earliest available position:
ALTER PIPELINE pubsub_pipe SET OFFSETS EARLIEST;
Note
-
Query
information_to capture the currentschema. PIPELINES_ SOURCE_ OFFSETS TASK_,ID KEY, andVALUEvalues before altering the offsets, so you can restore them if needed. -
After the offset change, the pipeline resumes extraction from the specified position in its next batch, regardless of previously processed offsets.
-
ALTER PIPELINE … SET OFFSET CURSOR '…'is a separate CDC-only command for MongoDB® and MySQL.It does not apply to Connector Pipelines.
Manage Connector Pipelines
Pipeline Lifecycle Operations
Refer to The Lifecycle of a Pipeline for more information.
Check Pipeline Status
SELECTPIPELINE_NAME,STATE,CONFIG_JSONFROM information_schema.PIPELINESWHERE PIPELINE_NAME = '<connector-pipeline>'
The following are the pipeline states:
-
Running: Pipeline is actively ingesting data
-
Stopped: Pipeline is stopped
-
Error: Pipeline encountered an error
Note
Because the Kafka Connect API does not signal when a source has been fully drained, START PIPELINE . may continue polling after all currently available records have been processed.LIMIT clause on START PIPELINE FOREGROUND, or use INTO PROCEDURE with an explicit stop condition.
Configuration Best Practices
Task Configuration
Parallel processing with tasks.:
-
Configure
tasks.based on data source partitioningmax -
For Amazon Kinesis: Set
tasks.equal to the number of shardsmax -
Google Cloud Pub/Sub: Set
tasks.tomax 1.Pub/Sub does not expose partitions, so parallel extraction is not supported at the pipeline level. To scale Pub/Sub ingest, scale on the Pub/Sub side. -
Monitor
TASK_distribution inID PIPELINES_SOURCE_ OFFSETS
-- Check task distributionSELECTTASK_ID,COUNT(*) as offset_countFROM information_schema.PIPELINES_SOURCE_OFFSETSWHERE PIPELINE_NAME = '<pipeline_name>'GROUP BY TASK_ID;
Security Best Practices
-
Credential Storage: Always use the
CREDENTIALSparameter for sensitive information, never include passwords inCONFIG -
Network Security: Ensure secure connections to data sources (use SSL/TLS when available)
-
Access Control: Grant minimum required permissions to pipeline users
-
Audit Logging: Enable logging for pipeline operations and monitor access
Performance Optimization
-
Configure Extraction Parameters: Use
SETstatements to tune the extraction performance:SET GLOBAL pipelines_extractor_max_batch_interval_ms = 1000; -
Computed Columns: Create computed columns for frequently accessed JSON fields
ALTER TABLE <pipeline_table>ADD COLUMN customer_id AS (JSON_EXTRACT_STRING(record, 'customer_id')) PERSISTED INT; -
Indexes: Add indexes on computed columns for better query performance
CREATE INDEX idx_customer_id ON <pipeline_table>(customer_id) -
Monitor Batch Times: Track batch processing time and adjust configuration if needed
-
Offset Progress: Regularly check
PIPELINES_to ensure offsets are advancingSOURCE_ OFFSETS -
Batch size and heap tuning.
Connector Pipeline batches are bounded by the connector's batch. size (default 100for Kinesis, maximum is10,000).Native Kafka's 1M-record batch does not apply. Large batch. size values can exhaust the connector's JVM heap; tune it with the pipelines_engine variable.cdc_ java_ heap_ size Example symptom: java.lang. OutOfMemoryError: Java heap space -
Project frequently queried fields into columns.
Prefer field mappings ( col <- value::field) overJSON_at query time.EXTRACT_ * Add computed columns and indexes on projected fields for large tables.
Examples
The following examples demonstrate how to ingest data from Amazon Kinesis and Google Pub/Sub.
Amazon Kinesis Pipeline
The following example demonstrates how to create a basic Connector Pipeline that automatically creates a table with a static schema and then ingests data from Amazon Kinesis into the table.
-- Enable the experimental featureSET GLOBAL experimental_features_config = "connector_pipelines_enabled=true";-- Create Kinesis pipelineCREATE INFERRED PIPELINE kinesis_pipelinesAS LOAD DATA CONNECTOR 'KinesisSourceConnector'CONFIG '{"kafka.topic": "orders-topic","kinesis.stream": "orders-stream","kinesis.region": "us-east-1","tasks.max": "3","output.value.field": "data"}'CREDENTIALS '{"aws.access.key.id": "<ACCESS_KEY>","aws.secret.access.key": "<SECRET_KEY>"}'FORMAT JSON;-- Start the pipelineSTART PIPELINE kinesis_pipelines;
Static Schema Table
When an inferred Connector Pipeline is created, SingleStore automatically creates a table.output. set to data and a payload shaped like {"id": <int>, "event": <string>, "amount": <float>}, the inferred table has the following columns::
-- Inferred table for kinesis_pipelines (single-value output mode)CREATE TABLE `kinesis_pipelines` (`id` BIGINT,`event` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,`amount` DOUBLE,SORT KEY `__UNORDERED` (),SHARD KEY ());
If a merge output mode is used, the inferred table includes both payload columns and the selected metadata columns.
Querying Data
Query the inferred columns:
-- Extract a specific fieldSELECT id, event, amountFROM kinesis_pipelinesWHERE event = 'order_placed';
+----+---------------+--------+
| id | event | amount |
+----+---------------+--------+
| 1 | order_placed | 99.95 |
| 2 | order_placed | 49.5 |
+----+---------------+--------+Amazon Kinesis Pipeline with Stored Procedure
The following example demonstrates how to use a stored procedure to process and transform incoming Kinesis data before inserting it into a custom table schema.INTO PROCEDURE clause.
-- Enable the experimental featureSET GLOBAL experimental_features_config = "connector_pipelines_enabled=true";-- Create the target table for parsed recordsCREATE TABLE parsed_kinesis_stream (partition_key VARCHAR(256),sequence_number VARCHAR(64),shard_id VARCHAR(64),data_base64 LONGTEXT,parsed_data AS FROM_BASE64(data_base64) :> JSON PERSISTED JSON,inserted_at DATETIME DEFAULT CURRENT_TIMESTAMP);-- Create the stored procedure to process incoming recordsDELIMITER //CREATE OR REPLACE PROCEDURE parse_kinesis_stream(batch QUERY(value JSON, timestamp BIGINT, topic VARCHAR(255))ASBEGININSERT INTO parsed_kinesis_stream (partition_key,sequence_number,shard_id,data_base64)SELECTJSON_EXTRACT_STRING(value, 'partitionKey'),JSON_EXTRACT_STRING(value, 'sequenceNumber'),JSON_EXTRACT_STRING(value, 'shardId'),JSON_EXTRACT_STRING(value, 'data')FROM batch;END //DELIMITER ;-- Create a Kinesis pipeline with INTO PROCEDURECREATE PIPELINE kinesis_pipeline_to_procAS LOAD DATA CONNECTOR 'KinesisSourceConnector'CONFIG '{"aws.access.key.id": "<aws_access_key>","aws.secret.access.key": "<aws_secret_access_key>","kafka.topic": "kinesis-topic","kinesis.stream": "my-kinesis-stream","kinesis.region": "us-east-1","tasks.max": 4}'CREDENTIALS '{}'BATCH_INTERVAL 2500INTO PROCEDURE parse_kinesis_streamFORMAT JSON;-- Start the pipelineSTART PIPELINE kinesis_pipeline_to_proc;
Target Table Schema
The target table stores both the raw base64-encoded data and a computed column that automatically decodes it:
|
Column |
Type |
Description |
|---|---|---|
|
|
|
Kinesis partition key |
|
|
|
Kinesis sequence number |
|
|
|
Source shard identifier |
|
|
|
Raw base64-encoded payload |
|
|
|
Automatically decoded payload (computed) |
|
|
|
Timestamp when record was inserted (defaults to |
Querying Data
Query the decoded data directly using the computed column:
-- Query decoded dataSELECTpartition_key,sequence_number,parsed_dataFROM parsed_kinesis_stream;
+-----------------+----------------------------------------------------------+----------------------------------------------------------------------------------------+
| partition_key | sequence_number | parsed_data |
+-----------------+----------------------------------------------------------+----------------------------------------------------------------------------------------+
| pending-order-1 | 49673494398310566511114890923921219322120066372600856578 | {"customer_id": "22222", "status": "pending", "order_total": 150.00} |
| active-order-2 | 49673494398310566511114890924392700391769771888175218690 | {"customer_id": "33333", "status": "active", "order_total": 450.00} |
| debug-test | 49673494398310566511114890671811828899685246464889454594 | {"customer_id": "12345", "event_type": "purchase"} |
| test-key-2 | 49673494398310566511114890486232044182282706583872864258 | {"customer_id": "67890", "event_type": "login", "timestamp": "2026-04-21T10:00:00Z"} |
+-----------------+----------------------------------------------------------+----------------------------------------------------------------------------------------+Working with Base64-Encoded Data
The parsed_
-- Decode and extract in a single querySELECTJSON_EXTRACT_STRING(parsed_data, 'customer_id') AS customer_id,JSON_EXTRACT_STRING(parsed_data, 'status') AS statusFROM parsed_kinesis_streamWHERE JSON_EXTRACT_STRING(parsed_data, 'status') = 'active';
+-------------+--------+
| customer_id | status |
+-------------+--------+
| 33333 | active |
+-------------+--------+Google Cloud Pub/Sub Pipeline
The following example creates an inferred pipeline that loads JSON messages from a Google Cloud Pub/Sub subscription.output. configuration is set to "", so the pipeline uses the entire message payload to infer the target table schema.
The payload contains id, event, and email fields.pubsub_ table.
CREATE TABLE `pubsub_events` (`id` BIGINT,`event` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,`email` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,SORT KEY `__UNORDERED` (),SHARD KEY ());
Create the inferred pipeline using the CloudPubSubSourceConnector.cps. and cps. specify the Google Cloud project and Pub/Sub subscription.CREDENTIALS clause provides the Google Cloud service account credentials.
CREATE INFERRED PIPELINE pubsub_eventsAS LOAD DATA CONNECTOR 'CloudPubSubSourceConnector'CONFIG '{"kafka.topic": "s2-events","tasks.max": "1","cps.project": "my-gcp-project","cps.subscription": "events-sub","output.value.field": ""}'CREDENTIALS '{ "gcp.credentials.json": "<SERVICE_ACCOUNT_JSON>" }'FORMAT JSON;START PIPELINE pubsub_events;SELECT id, event, email FROM pubsub_events;
+------+----------------+-------------------------+
| id | event | email |
+------+----------------+-------------------------+
| 1 | signup | alice@example.com |
| 2 | page_view | bob@example.com |
| 3 | order_placed | carol@example.com |
| 4 | signup | dave@example.com |
| 5 | item_added | alice@example.com |
+------+----------------+-------------------------+Last modified: