# Explode Array - Stream does not bring events where the array is not present

**URL:** <https://forum.confluent.io/t/explode-array-stream-does-not-bring-events-where-the-array-is-not-present/3392>\
**Category:** ksqlDB\
**Created:** [15 November 2021 21:02 UTC](https://forum.confluent.io/t/explode-array-stream-does-not-bring-events-where-the-array-is-not-present/3392 "2021-11-15T21:02:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josawhi](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@josawhi](https://forum.confluent.io/u/josawhi)\
**Post date:** [15 November 2021 21:02 UTC](https://forum.confluent.io/t/explode-array-stream-does-not-bring-events-where-the-array-is-not-present/3392/1 "2021-11-15T21:02:29Z")

</div>

Hello all! I have an event with the following structure:

“student”: {  
“name”: “jojo”,  
“address”: [  
{  
“street”: “Peny Lane”,  
“houseNo”: “42”  
}]}

So, I created the stream in this way:

student STRUCT\<  
name varchar,  
address varchar ARRAY\<STRUCT\< street varchar, houseNovarchar \>\>\>

The issue: When I get an event that does not have the “address” part, when I explode the array, the event won’t make it to the results. I read that Spark has a function called explode\_outer() that will bring a null instead.

Is there a similar function in Ksql? Any suggestions?

Cheers,  
Johanna

---

<div class="post-metadata">

**Author:** ![mjsax](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mjsax/32/3113_2.png) [@mjsax](https://forum.confluent.io/u/mjsax)\
**Post date:** [16 November 2021 16:09 UTC](https://forum.confluent.io/t/explode-array-stream-does-not-bring-events-where-the-array-is-not-present/3392/2 "2021-11-16T16:09:41Z")

</div>

Seems you are hitting [Dereference operator (-\>) with a null pointer · Issue #7185 · confluentinc/ksql · GitHub](https://github.com/confluentinc/ksql/issues/7185) ?

Can you try using `CASE` to distinguish between `NULL` and non-`NULL` case?

---

<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:** [15 December 2021 21:03 UTC](https://forum.confluent.io/t/explode-array-stream-does-not-bring-events-where-the-array-is-not-present/3392/3 "2021-12-15T21:03:03Z")

</div>

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