Uploaded image for project: 'Apache HAWQ'
  1. Apache HAWQ
  2. HAWQ-1455

Wrong results on CTAS query over catalog

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0.0-incubating
    • Component/s: Core
    • Labels:
      None

      Description

      The last ctas sql returns 0 tuple. This is wrong.

      $ cat catalog.sql
      create temp table t1 (tta varchar, ttb varchar);
      create temp table t2 (tta varchar, ttb varchar);
      insert into t1 values('a', '1');
      insert into t1 values('a', '2');
      insert into t1 values('tta', '3');
      insert into t1 values('ttb', '4');

      insert into t2 select pg_attribute.attname,t1.ttb from pg_attribute join t1 on pg_attribute.attname = t1.tta;

      $ psql -f catalog.sql -d postgres
      CREATE TABLE
      CREATE TABLE
      INSERT 0 1
      INSERT 0 1
      INSERT 0 1
      INSERT 0 1
      INSERT 0 0

      The join result should be as below for a new database.

      INSERT 0 4
      tta | ttb
      ----+----
      tta | 3
      ttb | 4
      tta | 3
      ttb | 4
      (4 rows)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Paul Guo Paul Guo
                Reporter:
                Paul Guo Paul Guo
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: