Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD268719B for ; Tue, 26 Jul 2011 23:37:32 +0000 (UTC) Received: (qmail 9143 invoked by uid 500); 26 Jul 2011 23:37:32 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 9008 invoked by uid 500); 26 Jul 2011 23:37:31 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 9000 invoked by uid 500); 26 Jul 2011 23:37:31 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 8997 invoked by uid 99); 26 Jul 2011 23:37:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 23:37:31 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 23:37:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ED2EC8B198 for ; Tue, 26 Jul 2011 23:37:09 +0000 (UTC) Date: Tue, 26 Jul 2011 23:37:09 +0000 (UTC) From: "Adam Kramer (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <959599896.9857.1311723429968.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (HIVE-436) MIN and MAX should be generic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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