{"push_id":799421746,"size":1,"distinct_size":1,"ref":"refs/heads/IMPALA-2020","head":"8665667708a421f6ee688882ba16f3d05e9e48e2","before":"4af01f00a2c2c55afa424e93fdde6448510d18e7","commits":[{"sha":"8665667708a421f6ee688882ba16f3d05e9e48e2","author":{"email":"f8249166ebee57207c05257bc9491ced177037e5@cloudera.com","name":"Christopher Channing"},"message":"IMPALA-2020: Support implicit rounding of decimals when casting between types.\n\nThis patch introduces a new query option called “DECIMAL_ROUND_MODE” which defines\ntwo states: [0 = TRUNCATE, 1 = ROUND].  In “ROUND” mode, Impala considers the value\nof the next digit to the right of the round boundary when making rounding decisions.\nIf this digit is >= 5 then an upward round will occur. The casting behaviour is modeled\non what Oracle’s RDBMS currently provides.\n\nA list of the type conversions handled are:\n\nDouble -> Decimal(P,S)\nFloat -> Decimal(P,S)\nString -> Decimal(P,S)\nDecimal(P,S) -> [String, Decimal(P2,S2) | Double | TinyInt | SmallInt | Int | BigInt]\nDecimal(P,S) -> VarChar(L):  When DECIMAL_ROUND_MODE is set to ROUND, the length of the\nvarchar is used as the round boundary. A leading zero will be suppressed in favour of\nshowing more digits when there is a constraint on space (which is determined by the\nlength of the varchar). For example:\n\n    cast(cast(-0.73761 as decimal(5, 5)) as varchar(5)) = \"-.738\"\n\nChange-Id: If757cfc4eb1086734f98386df7d42c4f188433b1","distinct":true,"url":"https://api.github.com/repos/cchanning/Impala/commits/8665667708a421f6ee688882ba16f3d05e9e48e2"}]}