Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1102

Self-join with a partitioned table returns wrong result data.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.9.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      See the following case.

      CREATE TABLE orders_partition
      (o_orderkey INT8, o_custkey INT8, o_totalprice FLOAT8, o_orderpriority TEXT,
        o_clerk TEXT, o_shippriority INT4, o_comment TEXT) USING CSV WITH ('csvfile.delimiter'='|')
      PARTITION BY COLUMN(o_orderdate TEXT, o_orderstatus TEXT);
      
      select a.o_orderstatus, count(*) as cnt
      from orders_partition a
      inner join orders_partition b
      on a.o_orderdate = b.o_orderdate
          and a.o_orderstatus = b.o_orderstatus
          and a.o_orderkey = b.o_orderkey
      where a.o_orderdate='1995-02-21'
      and a.o_orderstatus in ('F')
      group by a.o_orderstatus;
      

      Because of the where condition (where a.o_orderdate='1995-02-21 and a.o_orderstatus in ('F')), orders_partition table aliased 'a' is small and broadcast target table.
      In this case GlobalPlanner can't resolve which table is partitioned table.

        Attachments

          Activity

            People

            • Assignee:
              hjkim Hyoungjun Kim
              Reporter:
              hjkim Hyoungjun Kim
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: