Re: Reconstruct object through partial select query

2019-05-14 Thread Fabian Hueske
Hi, This looks like a good solution to me. The conversion mappers in step 1. and 4. should not cause a lot of overhead as they are chained to their predecessors. Best, Fabian Am Di., 14. Mai 2019 um 01:08 Uhr schrieb Shahar Cizer Kobrinsky < shahar.kobrin...@gmail.com>: > Hey Hequn & Fabian, >

Re: Reconstruct object through partial select query

2019-05-13 Thread Shahar Cizer Kobrinsky
Hey Hequn & Fabian, It seems like i found a reasonable way using both Row and my own TypeInfo: - I started by just using my own TypeInfo using your example. So i'm using a serializer which is basically a compound of the original event type serializer as well as a string array serializer

Re: Reconstruct object through partial select query

2019-05-13 Thread Shahar Cizer Kobrinsky
Thanks for looking into it Hequn! I do not have a requirement to use TaggedEvent vs Row. But correct me if I am wrong, creating a Row will require me knowing the internal fields of the original event in compile time, is that correct? I do have a requirement to support a generic original event

Re: Reconstruct object through partial select query

2019-05-12 Thread Hequn Cheng
Hi shahar, An easier way to solve your problem is to use a Row to store your data instead of the `TaggedEvent `. I think this is what Fabian means. In this way, you don't have to define the user-defined TypeFactory and use the Row type directly. Take `TaggedEvent` as an example, the corresponding

Re: Reconstruct object through partial select query

2019-05-10 Thread Shahar Cizer Kobrinsky
Hi Fabian, I have a trouble implementing the type for this operation, i wonder how i can do that. So given generic type T i want to create a TypeInformation for: class TaggedEvent { String[] tags T originalEvent } Was trying a few different things but not sure how to do it. Doesn't seem

Re: Reconstruct object through partial select query

2019-05-09 Thread Shahar Cizer Kobrinsky
Thanks Fabian, I'm looking into a way to enrich it without having to know the internal fields of the original event type. Right now what I managed to do is to map Car into a TaggedEvent prior to the SQL query, tags being empty, then run the SQL query selecting *origin, enrich(.. ) as tags* Not

Re: Reconstruct object through partial select query

2019-05-09 Thread Fabian Hueske
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,

Re: Reconstruct object through partial select query

2019-05-08 Thread shkob1
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:

Reconstruct object through partial select query

2019-05-08 Thread shkob1
Hey, I'm trying to create a SQL query which, given input from a stream with generic class T type will create a new stream which will be in the structure of { origin : T resultOfSomeSQLCalc : Array[String] } it seems that just by doing "SELECT *" i can convert the resulting table back to a