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

Can't Create Table with Interval Column Type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2.1
    • None
    • Parser
    • None
    • 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

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

            Dates

              Created:
              Updated: