{"push_id":1418686124,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"70ad07a9d20586ae182c4e60ed97bdddbcbceff3","before":"9785ed40d7fe4e1fcd440e55706519c6e5f8d6b1","commits":[{"sha":"70ad07a9d20586ae182c4e60ed97bdddbcbceff3","author":{"name":"Reynold Xin","email":"9a371236ace08d82aa86864cade97762c12d4503@databricks.com"},"message":"[SPARK-18522][SQL] Explicit contract for column stats serialization\n\n## What changes were proposed in this pull request?\nThe current implementation of column stats uses the base64 encoding of the internal UnsafeRow format to persist statistics (in table properties in Hive metastore). This is an internal format that is not stable across different versions of Spark and should NOT be used for persistence. In addition, it would be better if statistics stored in the catalog is human readable.\n\nThis pull request introduces the following changes:\n\n1. Created a single ColumnStat class to for all data types. All data types track the same set of statistics.\n2. Updated the implementation for stats collection to get rid of the dependency on internal data structures (e.g. InternalRow, or storing DateType as an int32). For example, previously dates were stored as a single integer, but are now stored as java.sql.Date. When we implement the next steps of CBO, we can add code to convert those back into internal types again.\n3. Documented clearly what JVM data types are being used to store what data.\n4. Defined a simple Map[String, String] interface for serializing and deserializing column stats into/from the catalog.\n5. Rearranged the method/function structure so it is more clear what the supported data types are, and also moved how stats are generated into ColumnStat class so they are easy to find.\n\n## How was this patch tested?\nRemoved most of the original test cases created for column statistics, and added three very simple ones to cover all the cases. The three test cases validate:\n1. Roundtrip serialization works.\n2. Behavior when analyzing non-existent column or unsupported data type column.\n3. Result for stats collection for all valid data types.\n\nAlso moved parser related tests into a parser test suite and added an explicit serialization test for the Hive external catalog.\n\nAuthor: Reynold Xin <rxin@databricks.com>\n\nCloses #15959 from rxin/SPARK-18522.","distinct":true,"url":"https://api.github.com/repos/dbtsai/spark/commits/70ad07a9d20586ae182c4e60ed97bdddbcbceff3"}]}
{"actor":{"display_login":"dbtsai-bot"}}