# How to auto create nested structured stream or table from a topic

**URL:** <https://forum.confluent.io/t/how-to-auto-create-nested-structured-stream-or-table-from-a-topic/7161>\
**Category:** ksqlDB\
**Created:** [4 February 2023 22:22 UTC](https://forum.confluent.io/t/how-to-auto-create-nested-structured-stream-or-table-from-a-topic/7161 "2023-02-04T22:22:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhruv](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@Dhruv](https://forum.confluent.io/u/Dhruv)\
**Post date:** [4 February 2023 22:22 UTC](https://forum.confluent.io/t/how-to-auto-create-nested-structured-stream-or-table-from-a-topic/7161/1 "2023-02-04T22:22:02Z")

</div>

how to auto create nested structured stream or table from a topic ? instead of manually creating like below  
{  
“fullName”: “Holly Waters”,  
“contractId”: “1234567”,  
“modemMACId”: “00-12-ab-34-cd-5e”,  
“deviceData”: “{"lastIpVisited": "8.8.8.8", "mbpsDown": "8.74", "mbpsUp": "1.01", "beam": 127}”,  
“serviceAddress”: {  
“street”: “11906 Albion St”,  
“city”: “Denver”,  
“country”: “USA”  
}.  
}

CREATE STREAM subscriber\_traffic(  
fullName VARCHAR,  
contractId VARCHAR,  
modemMACId VARCHAR,  
deviceData VARCHAR,  
serviceAddress STRUCT \<street VARCHAR, city VARCHAR, country VARCHAR \>)  
WITH (KAFKA\_TOPIC=‘subscriber\_traffic’,  
VALUE\_FORMAT=‘json’);

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [6 March 2023 22:23 UTC](https://forum.confluent.io/t/how-to-auto-create-nested-structured-stream-or-table-from-a-topic/7161/2 "2023-03-06T22:23:00Z")

</div>

This topic was automatically closed after 30 days. New replies are no longer allowed.
