Apache Flink Sql - How to access EXPR$0, EXPR$1 values from a Row in a table

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

Apache Flink Sql - How to access EXPR$0, EXPR$1 values from a Row in a table

M Singh
Hi:

I am working with Flink Sql and have a table with the following schema:

root
 |-- name: String
 |-- idx: Integer
 |-- pos: String
 |-- tx: Row(EXPR$0: Integer, EXPR$1: String)

How can I access the attributes tx.EXPR$0 and tx.EXPR$1 ?

I tried the following (the table is registered as 'tupleTable')

        Table tuples = myTableFuntionResultTuple.select("select name, idx, pos, tx.EXPR$0, tx.EXPR$1 from tupleTable");

but I get the following exception

Exception in thread "main" org.apache.flink.table.api.ExpressionParserException: Could not parse expression at column 8: `,' expected but `n' found
select name, idx, pos, tx.EXPR$0, tx.EXPR$1 from tupleTable

Please let me know how if there is any documentation or samples for accessing the tuples values in a table.

Thanks

Mans
Reply | Threaded
Open this post in threaded view
|

Re: Apache Flink Sql - How to access EXPR$0, EXPR$1 values from a Row in a table

Rong Rong
Hi Mans,

I am not sure if you intended to name them like this. but if you were to access them you need to escape them like `EXPR$0` [1].
Also I think Flink defaults unnamed fields in a row to `f0`, `f1`, ... [2]. so you might be able to access them like that. 

--
Rong


On Fri, Jun 14, 2019 at 1:55 PM M Singh <[hidden email]> wrote:
Hi:

I am working with Flink Sql and have a table with the following schema:

root
 |-- name: String
 |-- idx: Integer
 |-- pos: String
 |-- tx: Row(EXPR$0: Integer, EXPR$1: String)

How can I access the attributes tx.EXPR$0 and tx.EXPR$1 ?

I tried the following (the table is registered as 'tupleTable')

        Table tuples = myTableFuntionResultTuple.select("select name, idx, pos, tx.EXPR$0, tx.EXPR$1 from tupleTable");

but I get the following exception

Exception in thread "main" org.apache.flink.table.api.ExpressionParserException: Could not parse expression at column 8: `,' expected but `n' found
select name, idx, pos, tx.EXPR$0, tx.EXPR$1 from tupleTable

Please let me know how if there is any documentation or samples for accessing the tuples values in a table.

Thanks

Mans