(1) SkewJoinOptimizer adds items to ParseContext.topOps is different order in Java 8 vs Java 7. This leads to differences in EXPLAIN output related to MapWork.
(2) Dbproperties order for a "desc database" query is non-deterministic at the HiveMetastore end between Java 8 and Java 7 (because Thrift maps are un-ordered).
At client side, we serialize the dbproperties map returned from HMS as string and write it to a temp file. The FetchTask then reads the temp file and returns the string back to the user. In test environment, for consistent ordering, we should sort the map before it is serialized to the temp file.