We do want to use the PEEK_FIELDS behavior as Flink does support RecordType. But I believe Avatica is not used in Flink SQL API.
Is it possible to add an option in Calcite to disable the flattening behavior when using PEEK_FIELDS? Or what do you suggest? Thanks. On Fri, Jun 16, 2017 at 9:03 PM, Julian Hyde <jh...@apache.org> wrote: > PEEK_FIELDS was added as part of https://issues.apache.org/ > jira/browse/CALCITE-1208 <https://issues.apache.org/ > jira/browse/CALCITE-1208>, basically to allow us to implement Phoenix’s > “column family” feature, where it’s optional whether you qualify a column > with its column family. > > If you don’t have that requirement, you probably shouldn’t use PEEK_FIELDS > or PEEK_FIELDS_DEFAULT. > > Julian > > > On Jun 16, 2017, at 6:07 PM, Shuyi Chen <suez1...@gmail.com> wrote: > > > > Hi all, > > > > Our team are looking into integration of Flink with Calcite. We found > that > > when we set the RelRecordType to use the PEEK_FIELDS/PEEK_FIELDS_DEFAULT > > name resolution policy. A "select * from Table" will yield a recursively > > flatten result. For example, > > > > Table: > > a: Int > > b: Record(f1: Int, f2: Record(f3: String, f4:Int)) > > > > "select * from Table" will return tuples of (a, b.f1, b.f2.f3, b.f2.f4) > > instead of (a, b) when we use PEEK_FIELDS/PEEK_FIELDS_DEFAULT for the > > RelRecordType. > > > > Using FULLY_QUALIFIED will yield the expected result (a, b) > > > > We found that this recursive flattening behavior was controlled by this > > *kind* field in RelRecordType, which states in the documentation that > it's > > used for resolving fields in record types. > > > > I am wondering if this is an expected behavior, or should we fix it? > Thanks > > a lot. > > > > Shuyi > > > > > > > > -- > > "So you have to trust that the dots will somehow connect in your future." > > -- "So you have to trust that the dots will somehow connect in your future."