Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • 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 Query data bindings

Written by
Yandex Cloud
Updated at July 1, 2026
View in Markdown
  • Setting up a data binding
  • Data model
  • Data reading example

Yandex Data Streams data bindings simplify running recurrent queries on stored data by eliminating the need to specify all operation details.

Query example for reading data via 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 read Yandex Data Streams data via bindings, complete the following steps:

  1. Setting up a data connection.
  2. In the Type field, select Data Streams.
  3. In the Connection dropdown, select the connection you created in the first step.
  4. Specify the data binding name in the Name field.
  5. Specify the Yandex Data Streams stream name in the Stream field.
  6. Specify the data compression method in the Compression field.
  7. Specify the data transfer format in the Format field.
  8. Specify data columns and their data types in the Columns fields.
  9. To validate the data, click Preview.
  10. Click Create to create a data binding.

Data modelData model

Data is transmitted via Yandex Data Streams in binary format and is read via SQL statements.

SELECT
    <expression>
FROM
    <connection>.<stream_name>
WITH
(
    format=raw,
    SCHEMA
    (
        Data String
    )
)
WHERE <filter>;

Where:

  • <connection>: Name of the Data Streams data stream connection created in the previous step.
  • <stream_name>: Data Streams data stream name.

Data reading exampleData reading example

Query example for reading data from Yandex Data Streams and writing the results to Yandex Data Streams:

$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 source data stream in the SQL query
host String Query string parameter

Was the article helpful?

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