Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-26729 Add new UDFs to process Array type of data
  3. HIVE-27681

select queries having Array UDFs throw errors when element type is varchar

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • HiveServer2
    • None

    Description

      Test Queries

      CREATE TABLE temp (top ARRAY<STRING>);
      insert into temp values(array(cast('true' as VARCHAR(10))));
      select array_contains(top,cast(true as VARCHAR(10))) from temp;
      

       

      Exception

       

      org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 Argument type mismatch ''TRUE'': "varchar(10)" expected at function ARRAY_CONTAINS, but "string" is found
          at org.apache.hadoop.hive.ql.parse.type.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1473)

      As per Allowed Implicit Conversions String and varchar are convertible.  So we can modify this check and allow varchar <-> String conversion

       

      Attachments

        Activity

          People

            tarak271 Taraka Rama Rao Lethavadla
            tarak271 Taraka Rama Rao Lethavadla
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: