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

Lateral view on top of a view throws RuntimeException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.14.0, 1.0.0, 1.2.0, 1.1.0
    • Fix Version/s: 1.2.0
    • Labels:
      None

      Description

      Following the following sqls to create table and view and execute a select statement. It will throw the runtime exception:

      FAILED: RuntimeException org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException: "map" or "list" is expected at function SIZE, but "int" is found
      
       
      CREATE TABLE t1( symptom STRING,  pattern ARRAY<INT>,  occurrence INT, index INT);
      
      CREATE OR REPLACE VIEW v1 AS
      SELECT TRIM(pd.symptom) AS symptom, pd.index, pd.pattern, pd.occurrence, pd.occurrence as cnt from t1 pd;
      
      SELECT pattern_data.symptom, pattern_data.index, pattern_data.occurrence, pattern_data.cnt, size(pattern_data.pattern) as pattern_length, pattern.pattern_id
      FROM v1 pattern_data LATERAL VIEW explode(pattern) pattern AS pattern_id;
      

        Attachments

          Activity

            People

            • Assignee:
              aihuaxu Aihua Xu
              Reporter:
              aihuaxu Aihua Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: