Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-21062

Hive 2.X auto converts a round decimal to integer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.4
    • None
    • Query Processor
    • None

    Description

      0: jdbc:hive2://localhost:10000> select 1.0 ;
      +------+
      | _c0  |
      +------+
      | 1    |
      +------+
      

      It happens with parameters to functions as well

      0: jdbc:hive2://localhost:10000> select CONCAT("hi",1.0) ;
      +------+
      | _c0  |
      +------+
      | hi1  |
      +------+
      

      Hive reads 1.0 as decimal(1,0), and then may be is converting it to int ?

      0: jdbc:hive2://localhost:10000> EXPLAIN EXTENDED select 1.0;
      +--------------------------------------------------+
      |                     Explain                      |
      +--------------------------------------------------+
      | STAGE DEPENDENCIES:                              |
      |   Stage-0 is a root stage                        |
      |                                                  |
      | STAGE PLANS:                                     |
      |   Stage: Stage-0                                 |
      |     Fetch Operator                               |
      |       limit: -1                                  |
      |       Processor Tree:                            |
      |         TableScan                                |
      |           alias: _dummy_table                    |
      |           Row Limit Per Split: 1                 |
      |           GatherStats: false                     |
      |           Select Operator                        |
      |             expressions: 1 (type: decimal(1,0))  |
      |             outputColumnNames: _col0             |
      |             ListSink                             |
      |                                                  |
      +--------------------------------------------------+
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rshetye Ravi Shetye
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: