flink sql syntax for accessing object

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

flink sql syntax for accessing object

Fanbin Bu
Hi,

I have a table with schema being a scala case class or a Map. How do I access the field?
Tried the following and it doesn't work.

case class MyObject(myField: String)
case class Event(myObject: MyObject, myMap: Map[String, String])
table = tableEnv.fromDataStream[Event](myStream, 'myObject, 'myMap)
tableEnv.scan(tableName).select("myObject.field, myMap['key']")

What is the right way to access those if possible?

Thanks,
Fanbin