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

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

Seems you are hitting Dereference operator (->) with a null pointer · Issue #7185 · confluentinc/ksql · GitHub ?

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

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