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

Support simple equality operations between MAP/LIST/STRUCT data types

    XMLWordPrintableJSON

Details

    Description

      Currently equality operations between non primitive data types (MAP, LIST, STRUCT) work in some very limited cases e.g:

      create table table_map_types (id int, c1 map<int,int>, c2 map<int,int>);
      select id from table_map_types where map(1,1) IN (map(1,1), map(1,2), map(1,3)); 
      

      but this feature was never introduced explicitly (zero tests & JIRAs around the subject) and the vast majority of queries involving comparisons between non primitive data types now fail at compile time.

      The goal of this issue is to support simple equality operations:

      • EQUALS(=)
      • NOT_EQUALS(<>),
      • IN,
      • IS DISTINCT FROM,
      • IS NOT DISTINCT FROM

      between MAP/LIST/STRUCT data types when the compared types are identical (same type category and identical component types). The following examples illustrate the idea of types being identical:

      MAP<INT,INT> EQUALS MAP<INT,INT> OK
      MAP<INT,INT> EQUALS MAP<BIGINT,INT> KO
      STRUCT<INT,INT> EQUALS STRUCT<INT, INT> KO
      STRUCT<INT,INT> EQUALS STRUCT<INT, BIGINT> OK
      LIST<INT> EQUALS LIST<INT> OK
      LIST<INT> EQUALS LIST<BIGINT> KO
      

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m