Grokbase Groups Hive user May 2009
FAQ
Hi Hive users,

I just released a tool to import data from SQL databases into files
stored on HDFS ("Sqoop"; see
http://issues.apache.org/jira/browse/hadoop-5815). An extension that
I'm now working on is to use the Hive JDBC client to connect to a Hive
metastore attached to the same HDFS instance and carry the table
forward from HDFS into Hive by executing auto-generated "CREATE TABLE"
and "LOAD DATA" statements.

Most of the JDBC SQL types translate straightforwardly into Hive
types. But the SQL DECIMAL type a.k.a. NUMERIC is a fixed-precision
number value type. This is certainly not an INTEGER/BIGINT in Hive
parlance, but I'm hesitant to use DOUBLE as this is imprecise. I'd
like some suggestions from the Hive community on where I should go
with this:

Option A) Use DOUBLE and lose the precise nature of the type
Option B) Convert to STRING and lose the numeric nature of the type
(e.g., for sorting purposes)
Option C) Is someone with more hive-fu than I willing to implement
fixed-place arithmetic types? :)
Option D) Something I'm overlooking?

Cheers,
- Aaron Kimball

Search Discussions

  • Zheng Shao at May 13, 2009 at 5:04 pm
    Hi Aaron,

    My suggestion will be to use DOUBLE for now, till DECIMAL is supported by
    Hive.
    It's true that DOUBLE is not precise, but it didn't block us on any usage of
    Hive here yet.

    Zheng
    On Wed, May 13, 2009 at 11:40 AM, Aaron Kimball wrote:

    Hi Hive users,

    I just released a tool to import data from SQL databases into files
    stored on HDFS ("Sqoop"; see
    http://issues.apache.org/jira/browse/hadoop-5815). An extension that
    I'm now working on is to use the Hive JDBC client to connect to a Hive
    metastore attached to the same HDFS instance and carry the table
    forward from HDFS into Hive by executing auto-generated "CREATE TABLE"
    and "LOAD DATA" statements.

    Most of the JDBC SQL types translate straightforwardly into Hive
    types. But the SQL DECIMAL type a.k.a. NUMERIC is a fixed-precision
    number value type. This is certainly not an INTEGER/BIGINT in Hive
    parlance, but I'm hesitant to use DOUBLE as this is imprecise. I'd
    like some suggestions from the Hive community on where I should go
    with this:

    Option A) Use DOUBLE and lose the precise nature of the type
    Option B) Convert to STRING and lose the numeric nature of the type
    (e.g., for sorting purposes)
    Option C) Is someone with more hive-fu than I willing to implement
    fixed-place arithmetic types? :)
    Option D) Something I'm overlooking?

    Cheers,
    - Aaron Kimball


    --
    Yours,
    Zheng

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedMay 13, '09 at 3:41a
activeMay 13, '09 at 5:04p
posts2
users2
websitehive.apache.org

2 users in discussion

Zheng Shao: 1 post Aaron Kimball: 1 post

People

Translate

site design / logo © 2022 Grokbase