Hi,

you can use the value construction function ROW to create a nested row (or
object).
However, you have to explicitly reference all attributes that you will add.

If you have a table Cars with (year, modelName) a query could look like
this:

SELECT
  ROW(year, modelName) AS car,
  enrich(year, modelName) AS tags
FROM Cars;

Handling many attributes is always a bit painful in SQL.
There is an effort to make the Table API easier to use for these use cases
(for example Column Operations [1]).

Best, Fabian

[1] https://issues.apache.org/jira/browse/FLINK-11967



Am Do., 9. Mai 2019 um 01:44 Uhr schrieb shkob1 <shahar.kobrin...@gmail.com
>:

> Just to be more clear on my goal -
> Im trying to enrich the incoming stream with some meaningful tags based on
> conditions from the event itself.
> So the input stream could be an event looks like:
> Class Car {
>   int year;
>   String modelName;
> }
>
> i will have a config that are defining tags as:
> "NiceCar" -> "year > 2015 AND position("Luxury" in modelName) > 0"
>
> So ideally my output will be in the structure of
>
> Class TaggedEvent<Car> {
>    Car origin;
>    String[] tags;
> }
>
>
>
>
>
>
> --
> Sent from:
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>

Reply via email to