Ports HIVE-5783 to the parquet-hive module

Ports HIVE-5783 to the parquet-hive module so that patches
can be ported between the two code bases with ease. Note
that the code base in Hive itself should be considered the
golden copy and any changes made there and then ported
to the parquet-hive module.