Hi All!

I was trying to flatten a nested tuple into named columns with the
fromDataStream method and I hit some problems with mapping tuple fields to
column names.

It seems like the `f0 as ColumnName` kind of expressions are not parsed
correctly.

It is very easy to reproduce:
tableEnv.fromDataStream(env.fromElements(Tuple2.of("a", 1)), "f0 as name,
f1 as age");

This leads to the following 2 kinds of errors depending on how you write
it:
 - Alias 'name' is not allowed if other fields are referenced by position.
 - Could not parse expression at column 7: `(' expected but `'' found
f0 as 'name', f1 as 'age'

I could not find any test cases that would use this logic so I wonder if I
am doing something wrong here, the docs show that this should be possible:
https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/common.html#tuples-scala-and-java-and-case-classes-scala-only

I was actually trying to extract nested tuple fields this way but I did not
get that far. It also seems to fail for Row data types.

What am I doing wrong?

Gyula

Reply via email to