

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://amazonaws-china.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# SYS\$1STREAM\$1SCAN\$1STATES
<a name="r_SYS_STREAM_SCAN_STATES"></a>

Records scan states for records loaded via streaming ingestion.

SYS\$1STREAM\$1SCAN\$1STATES is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see [Visibility of data in system tables and views](cm_chap_system-tables.md#c_visibility-of-data).

## Table columns
<a name="r_SYS_STREAM_SCAN_STATES-table-rows"></a>

[\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/redshift/latest/dg/r_SYS_STREAM_SCAN_STATES.html)

The following query shows stream and topic data for specific queries.

```
select query_id,mv_name::varchar,external_schema_name::varchar,stream_name::varchar,sum(scanned_rows) total_records,
sum(scanned_bytes) total_bytes from sys_stream_scan_states where query in (5401180,8601939) group by 1,2,3,4;

  query_id  |    mv_name     | external_schema_name |   stream_name   | total_records |  total_bytes
------------+----------------+----------------------+-----------------+---------------+----------------
 5401180    | kinesistest    | kinesis              | kinesisstream   |    1493255696 | 3209006490704
 8601939    | msktest        | msk                  | mskstream       |      14677023 |   31056580668
(2 rows)
```