trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.41k stars 3k forks source link

Consider supporting field-name-based struct column evolution in Hive #1556

Open lxynov opened 5 years ago

lxynov commented 5 years ago

Hive Connector supports schema evolution for a struct-typed column if the evolution is to add or drop fields from the end. https://github.com/prestosql/presto/blob/9ea6d0b7c685123c63403b5af4a952b4f5474695/presto-hive/src/main/java/io/prestosql/plugin/hive/HiveCoercionPolicy.java#L116

Is it reasonable to do the coercion based on field names? So that the evolution can add fields in the middle of such a struct column.

cc: @wagnermarkd @Yaliang

lxynov commented 5 years ago

@dain Could you take a look when you get time? The idea is to support column evolution from type struct<a:int, b:int> to struct<a:int, c:int, b:int>. I encountered a use case doing so.