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

Can't Create Table with Interval Column Type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: Parser
    • Labels:
      None
    • Environment:

      CentOS 6.8 Hortonworks HDP 2.5 Apache Hive (version 1.2.1000.2.5.3.0-37)

      Description

      You can create a table with an interval type via create table as select but not directly with create table.

      This works

      create table test_interval 
      as 
      select  interval '1' day as day_interval, 
              interval '1' month as month_interval;
      
      describe test_interval;
      +-----------------+----------------------+----------+--+
      |    col_name     |      data_type       | comment  |
      +-----------------+----------------------+----------+--+
      | day_interval    | interval_day_time    |          |
      | month_interval  | interval_year_month  |          |
      +-----------------+----------------------+----------+--+
      

      This raises an error.

      create table test_interval(                                                         
         day_interval 	interval_day_time,                                                   
         month_interval 	interval_year_month
         );
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Absolutesantaja Shawn Weeks
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: