Since the exception (IOOBE) is not a user error, this seems to be a bug.

Could you perhaps reproduce this as SQL (DDL plus a query) in the “server” 
module, say server/src/test/resources/sql/type.iq?


> On Aug 14, 2018, at 6:59 AM, Rong Rong <[email protected]> wrote:
> 
> Hi Devs,
> 
> I am trying to utilize Calcite type inference in my Flink and realize that
> one of the situations will cause exception when trying to infer the operand
> type based on a StructType return type. [1]
> 
> Seems like there's a requirement [2] that if return type is a struct, the
> operand # and return type field list size need to be the same. I was
> wondering if there is specific design reason behind this such as it is
> required to flatten the nested structure field?
> 
> I have attached a test to reproduced the exception when dealing with
> records that has only 1 single field in the field list [3].
> 
> Much appreciate the pointers and suggestions in advance.
> 
> --
> Rong
> 
> [1] https://issues.apache.org/jira/browse/FLINK-10019
> [2]
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql/type/InferTypes.java#L68
> [3]
> https://github.com/apache/calcite/compare/master...walterddr:struct_type_inference_error

Reply via email to