lirui-apache commented on issue #9927: [FLINK-14397][hive] Failed to run Hive 
UDTF with array arguments
URL: https://github.com/apache/flink/pull/9927#issuecomment-543590413
 
 
   > This change seems to assume that all elements in the list would be of the 
same type, while the original version doesn't. Wondering if the new assumption 
always hold for Hive array?
   
   Yeah I think it's safe to assume elements in a Hive array are of the same 
type. Hive [checks element 
type](https://github.com/apache/hive/blob/rel/release-2.3.4/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/ListTypeInfo.java#L80)
 in the `equals` method of `ListTypeInfo`, which is used to determine whether 
data insertion is allowed or conversion is needed. For example, it's not 
allowed to insert an `array<int>` into a column of `array<bigint>` type because 
the src and dest have different type info.
   
   I also want to clarify that this new assumption/limitation is imposed on us 
by Flink. While Hive UDTF may very well handle Object[], Flink assumes an array 
argument should contains elements of the same type. Therefore, even if Hive 
fails to satisfy this assumption (due to bug or behavior change), I think we 
have to cover it up in `toFlinkObject`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to