You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Fanbin Bu <fa...@coinbase.com> on 2019/08/23 22:48:00 UTC

flink sql syntax for accessing object

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