spotify/luigi — pull request #384 by rtshadow (2014-07-22 21:27:17+00:00)
Title: Metastore client properly checks existence of complex partitions

Metastore client was given a partition definition in dictionary, which was later converted to "partition string". This conversion was done just by iterating over elements in a dictionary and, as there's no particular order on elements when doing such iteration, resulting "string" was quite random. Later on, the compared this string to the values returned by hive As a result, it sometimes happened, that it was comparing string like "p1=a/p2=b" to the string "p2=b/p1=a" and thus failed to recognize that such partition exists.
In fact, hive doesn't care about ordering of partitions - "p1=a/p2=b" and "p2=b/p1=a" are perceived as the same thing. Metastore client should follow the same logic and treat them as equal, which is exactly what is provided by this patch.