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

UNION ALL does not allow different types in the same column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3.0, 0.6.0
    • 0.3.0
    • Query Processor
    • None
    • Reviewed

    Description

      explain INSERT OVERWRITE TABLE t
          SELECT s.r, s.c, sum(s.v) FROM
          (
            SELECT a.r AS r, a.c AS c, a.v AS v FROM t1 a
            UNION ALL
            SELECT b.r AS r, b.c AS c, 0 + b.v AS v FROM t2 b
          ) s
          GROUP BY s.r, s.c;
      

      Both a and b have 3 string columns: r, c, and v.

      It compiled successfully but failed during runtime.
      "Explain" shows that the plan for the 2 union-all operands have different output types that are converged to STRING, but there is no UDFToString inserted for "0 + b.v AS v" and as a result, SerDe was failing because it expects a String but is passed a Double.

      Attachments

        1. hive-285.1.patch
          2 kB
          Raghotham Murthy
        2. hive-285.2.patch
          2 kB
          Raghotham Murthy

        Issue Links

          Activity

            People

              rsm Raghotham Murthy
              zshao Zheng Shao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: