hortonworks / hive-json

A rough prototype of a tool for discovering Apache Hive schemas from JSON documents.
42 stars 32 forks source link

Fix generation of union types #5

Closed muhlig closed 8 years ago

muhlig commented 11 years ago

Currently generation of union types is not correctly handled and can result in nested union types in the shape of e.g. union<string,union<int,string,union<tinyint,binary>> depending on the input data. This pull request fixes this issue by computing the least upper bound for the types that are part of union types.

omalley commented 8 years ago

Ok, I took a different approach for this, but I think I should have addressed your problem. It aggressively merges everything into unions. In particular, it will merge the different unions into a single one, so you'll never end up with a union of unions.