Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Query
    • Data formats and compression algorithms
      • Reading data via connections
      • Reading data via bindings
      • Writing data
    • Working with Managed Service for ClickHouse® databases
    • Working with Yandex MPP Analytics for PostgreSQL databases
    • Working with Managed Service for MySQL® databases
    • Working with Managed Service for PostgreSQL databases
    • Working with Managed Service for YDB databases
    • Reading Iceberg tables
  • Access management
  • Pricing policy
  • Integrations
  • Audit Trails events
  • FAQ

In this article:

  • Setting up a data binding
  • Data model
  • Data reading example
  1. Data sources and sinks
  2. Working with Data Streams
  3. Reading data via bindings

Reading data via bindings

Written by
Yandex Cloud
Improved by
ilya
Updated at August 17, 2026
View in Markdown
  • Setting up a data binding
  • Data model
  • Data reading example

Data bindings allow you to regularly query Yandex Data Streams data without having to specify connection settings and data format in each query.

Example of reading data using bindings:

SELECT
    JSON_VALUE(CAST(Data AS Json), "$.action") AS action
FROM bindings.`input_stream`
LIMIT 10;

Note

Data from a streaming source is delivered as an infinite stream. To prevent infinite streaming and get output in the console, the example uses the LIMIT clause that limits the number of result rows.

Setting up a data bindingSetting up a data binding

To create a binding to read data from Yandex Data Streams:

  1. Set up a data connection.

  2. Navigate to Yandex Query.

  3. In the left-hand panel, switch to the Bindings tab.

  4. Click Create.

  5. Under Connection parameters:

    1. In the Type field, select Data Streams.
    2. In the Connection field, select the connection you created in the first step.
  6. Under Binding parameters:

    1. In the Name field, specify the binding name.
    2. In the Stream field, enter the name of the data stream in Yandex Data Streams.
    3. In the Compression field, specify the data compression method.
    4. In the Format field, specify the data format.
    5. In the Columns fields, specify the list of columns and their data types.
  7. To validate the data, click Preview.

  8. Click Create.

Data modelData model

Data is transmitted via Yandex Data Streams in binary format. To read data using a binding, use an SQL statement of the following format:

SELECT
    <expression>
FROM bindings.`<binding_name>`
WHERE
    <filter>;

Where:

  • <statement>: Statement that determines the result of the query.
  • <binding_name>: Name of the data binding you created earlier.
  • <filter>: Data filtering condition.

Data reading exampleData reading example

Query example for reading data from Yandex Data Streams via bindings:

$data =
SELECT
    JSON_VALUE(Data, "$.host") AS host,
    JSON_VALUE(Data, "$.count") AS count,
    JSON_VALUE(Data, "$.tag") AS tag,
FROM
(
    SELECT
        CAST(Data AS Json) AS Data
    FROM bindings.`binding_name`
)
WHERE
    JSON_VALUE(Data, "$.tag") = "my_tag";

SELECT
    *
FROM
    $data
LIMIT 10;

Where:

Field

Type

Description

binding_name

Name of the binding to the data source stream.

host

String

Host name.

count

String

Number of events.

tag

String

Event tag.

Was the article helpful?

Previous
Reading data via connections
Next
Writing data
© 2026 Direct Cursus Technology L.L.C.