# How to remove deduplication upon struct in ksqldb

**URL:** https://forum.confluent.io/t/how-to-remove-deduplication-upon-struct-in-ksqldb/3927
**Category:** ksqlDB
**Created:** [19 January 2022 08:49 UTC](https://forum.confluent.io/t/how-to-remove-deduplication-upon-struct-in-ksqldb/3927 "2022-01-19T08:49:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Anusha](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Anusha](https://forum.confluent.io/u/Anusha)
#### Post date: [19 January 2022 08:49 UTC](https://forum.confluent.io/t/how-to-remove-deduplication-upon-struct-in-ksqldb/3927/1 "2022-01-19T08:49:09Z")

</div>

Hi ,  
Step 1 i am creating stream with create Type with struct format as json

```auto
CREATE TYPE contact AS STRUCT<"otherPhone" VARCHAR, "workPhone" VARCHAR, "address1" VARCHAR, "city" VARCHAR, "country" VARCHAR, "zipCode" VARCHAR>;

CREATE STREAM event_load(KEY VARCHAR KEY,"eventType" VARCHAR, "platform" VARCHAR, "billingAccount" BILLINGACCOUNT, "soldToContact" CONTACT, "billToContact" CONTACT, "subscription" "subscription") WITH (KAFKA_TOPIC = 'topic1.in', VALUE_FORMAT = 'JSON',PARTITIONS=1);
upon this i am applying select * 

CREATE STREAM dsc_events_supply WITH (KAFKA_TOPIC = 'subscription.in, VALUE_FORMAT = 'JSON',PARTITIONS=1) AS select * from event_load where "eventType" in ('SubscriptionCreated') ;

```

so here is the problem: when I alter the stream event\_load with add column and dropping stream `dsc_events_supply` and recreating it for addition of new column from event\_load in my subscription.in topic data is loaded twice: 1st set of data which was already existing and second set of data with new added column, so duplication is happening. I am not able use this [How to find distinct values in a stream of events using ksqlDB](https://kafka-tutorials.confluent.io/finding-distinct-events/ksql.html) because my data is struct making group by columns into primary key. So how to fix this issue

---

<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: [18 February 2022 08:49 UTC](https://forum.confluent.io/t/how-to-remove-deduplication-upon-struct-in-ksqldb/3927/2 "2022-02-18T08:49:51Z")

</div>

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