confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
89 stars 1.04k forks source link

Add capability to alter a struct in query #6743

Open rahulbats opened 3 years ago

rahulbats commented 3 years ago

I can select a struct inside the source stream but if i want to add a field to the struct theres no way of doing it. I have to manually select all fields from the source struct. If the source struct is huge it leads to unnecesary complication.

have ADD_FIELD , REMOVE_FIELD and UPDATE_FIELD

ADD_FIELD(original, field_name, value) REMOVE_FIELD(original, field_name) UPDATE_FIELD(original, field_name, new value)

agavra commented 3 years ago

In order to implement this, we'd need to support the ability for "literal params" - i.e. knowing that a certain parameter passed in is not going to change based on the input. That way we could implement a schema provider that determined the field name by examining the contents of the string literal param for field_name

adiglp commented 1 year ago

Hello @agavra , any update about this issue? we're facing it too, thanks in advance

juanlucruz commented 1 month ago

hi @agavra are there any plans of including this one in next releases? Thanks!