hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gunther Hagleitner (JIRA)" <>
Subject [jira] [Commented] (HIVE-2693) Add DECIMAL data type
Date Tue, 18 Dec 2012 20:06:15 GMT


Gunther Hagleitner commented on HIVE-2693:

Mark, thanks for the additional tests, I'll take a closer look this afternoon.

To answer the questions:

1: I introduced +/-2 when I was at a point in the debugging stage where paranoia took over.
I can remove that, it'll make the code more readable.
2: It is only implicitly tested in all the queries that use a reduce stage. I agree that a
test of just that code would be good. Is there a place in the current unit tests that already
does that/that I could use as a model?

Sign bit: I introduced a value for zero to avoid a "factor" of negative infinity. If you lump
0 into either the positive or negative bucket it would become the number that has an infinite
number of zeros before the first non-zero digit (after the decimal point). MIN_INT might have
been an option, but it seems cleaner to just make the sign have three states (-1,0,1). BigDecimal
class in Java itself for instance more or less randomly defines precision of 0 (i.e.: number
of unscaled digits) as 1. 

Non-deterministic order: 3.14 and 3.140 are indeed equal. Their representation should be exactly
the same (<1>,<1>,<314>). Given that, I'm not sure how to enforce a deterministic
order or even what that would be. Are you suggesting 3.14 should always appear before 3.140?

I am worried about your comments about the where clause. I'll take a look at the tests. But
you say it's not working right?

> Add DECIMAL data type
> ---------------------
>                 Key: HIVE-2693
>                 URL:
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor, Types
>    Affects Versions: 0.10.0
>            Reporter: Carl Steinbach
>            Assignee: Prasad Mujumdar
>         Attachments: 2693_7.patch, 2693_8.patch, 2693_fix_all_tests1.patch, HIVE-2693-10.patch,
HIVE-2693-11.patch, HIVE-2693-12-SortableSerDe.patch, HIVE-2693-13.patch, HIVE-2693-1.patch.txt,
HIVE-2693-all.patch, HIVE-2693-fix.patch, HIVE-2693.patch, HIVE-2693-take3.patch, HIVE-2693-take4.patch
> Add support for the DECIMAL data type. HIVE-2272 (TIMESTAMP) provides a nice template
for how to do this.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message