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

partition column type validation doesn't quite work for dates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • None
    • None

    Description

      Another interesting issue...

      hive> create table zzzzz(c string) partitioned by (i date,j date);
      OK
      Time taken: 0.099 seconds
      hive> alter table zzzzz add partition (i='2012-01-01', j='foo');          
      FAILED: SemanticException [Error 10248]: Cannot add partition column j of type string as it cannot be converted to type date
      hive> alter table zzzzz add partition (i='2012-01-01', j=date 'foo');
      OK
      Time taken: 0.119 seconds
      

      The fake date is caught in normal queries:

      hive> select * from zzzzz where j == date 'foo';
      FAILED: SemanticException Unable to convert date literal string to date value.
      

      Attachments

        1. HIVE-5686.patch
          4 kB
          Sergey Shelukhin
        2. HIVE-5686.01.patch
          4 kB
          Sergey Shelukhin
        3. HIVE-5686.02.patch
          6 kB
          Sergey Shelukhin
        4. HIVE-5686.03.patch
          6 kB
          Sergey Shelukhin
        5. HIVE-5686.03.patch
          5 kB
          Sergey Shelukhin
        6. HIVE-5686.03.patch
          6 kB
          Sergey Shelukhin
        7. HIVE-5686.04.patch
          6 kB
          Sergey Shelukhin

        Activity

          People

            sershe Sergey Shelukhin
            sershe Sergey Shelukhin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: