[ https://issues.apache.org/jira/browse/HIVE-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Kramer updated HIVE-436: ----------------------------- Description: MIN and MAX functions currently return the DOUBLE type...but really, these should be generic UDFs. It makes sense to talk about minima and maxima for int, bigint, double, and even string types. In some cases like SUM, it's possible that the result would overflow making DOUBLE more useful as it can drop digits and swap to scientific notation, but MIN and MAX by definition cannot have this problem because the answers are always represented in the column they are run across. Easy workaround: CAST all of my MINs and MAXes from DOUBLE to INT, but these should work with STRING too. was: MIN and MAX functions currently return the DOUBLE type...but really, they should return the same type as the column they operate on. In some cases like SUM, it's possible that the result would overflow making DOUBLE more useful as it can drop digits and swap to scientific notation, but MIN and MAX by definition cannot have this problem because the answers are always represented in the column they are run across. Easy workaround: CAST all of my MINs and MAXes. It's just a wish. Issue Type: Improvement (was: Wish) Summary: MIN and MAX should be generic (was: MIN and MAX should inherit type) > MIN and MAX should be generic > ----------------------------- > > Key: HIVE-436 > URL: https://issues.apache.org/jira/browse/HIVE-436 > Project: Hive > Issue Type: Improvement > Components: UDF > Reporter: Adam Kramer > > MIN and MAX functions currently return the DOUBLE type...but really, these > should be generic UDFs. It makes sense to talk about minima and maxima for > int, bigint, double, and even string types. > In some cases like SUM, it's possible that the result would overflow making > DOUBLE more useful as it can drop digits and swap to scientific notation, but > MIN and MAX by definition cannot have this problem because the answers are > always represented in the column they are run across. > Easy workaround: CAST all of my MINs and MAXes from DOUBLE to INT, but these > should work with STRING too. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira