Table API, accessing nested fields

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Table API, accessing nested fields

orips

How can I access nested fields e.g. in select statements?

For example, this won't work:

     val table = tenv
      .fromDataStream(stream)
      .select($"context.url", $"name")   


What is the correct way?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Table API, accessing nested fields

Dawid Wysakowicz-2

You should use the get method:

     val table = tenv
      .fromDataStream(stream)
      .select($"context".get("url"), $"name")

Best,

Dawid

On 10/11/2020 10:15, Ori Popowski wrote:

How can I access nested fields e.g. in select statements?

For example, this won't work:

     val table = tenv
      .fromDataStream(stream)
      .select($"context.url", $"name")   


What is the correct way?

Thanks.

signature.asc (849 bytes) Download Attachment