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

filter bug of UNION ALL when hive.ppd.remove.duplicatefilters=true and filter condition is type incompatible column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.2.1
    • None
    • Logical Optimizer
    • None

    Description

      For UNION ALL , when an union operator is constant column (such as '0L', BIGINT Type) and its corresponding column has incompatible type (such as INT type).
      Query with filter condition on type incompatible column on this UNION ALL will cause IndexOutOfBoundsException.

      Such as TPC-H table "orders",in the following query:
      Type of 'orders'.'o_custkey' is INT normally, while the type of corresponding constant column "0" is BIGINT( `0L AS `o_custkey` ).
      This following query (with filter "type incompatible column 'o_custkey' ") will fail with java.lang.IndexOutOfBoundsException :

      set hive.cbo.enable=false;
      set hive.ppd.remove.duplicatefilters=true;
      CREATE TABLE `orders`(
        `o_orderkey` int, 
        `o_custkey` int, 
        `o_orderstatus` string, 
        `o_totalprice` double, 
        `o_orderdate` string, 
        `o_orderpriority` string, 
        `o_clerk` string, 
        `o_shippriority` int, 
        `o_comment` string);
      
      SELECT o_orderkey
      FROM   (
                    SELECT `o_orderkey` ,
                           `o_custkey`
                    FROM   `orders`
                    UNION ALL
                    SELECT `o_orderkey`,
                           0L  AS `o_custkey`
                    FROM   `orders`) `oo`
      WHERE  o_custkey<10;
      

      Attachments

        1. HIVE-11880.04.patch
          5 kB
          WangMeng
        2. HIVE-11880.03.patch
          5 kB
          WangMeng
        3. HIVE-11880.02.patch
          5 kB
          WangMeng
        4. HIVE-11880.01.patch
          5 kB
          WangMeng

        Issue Links

          Activity

            People

              sjtufighter WangMeng
              sjtufighter WangMeng
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: