Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-1157

LP Bug: 1442932 - Query compilation returns internal error in GenItemFunc.cpp:1364 about encode storage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.1 (pre-incubation)
    • sql-cmp
    • None

    Description

      In the 1.1.0rc0 (v0410) build, the following TPCH query no longer compiles. It returns a compiler internal error:

          • ERROR[7000] An internal error occurred in the code generator in file ../generator/GenItemFunc.cpp at line 1363: Not enough storage allocated for encode.

      This is a regression introduced between the v0407 build and the 1.1.0rc0 (v0410) build. The compilation of this TPCH query still worked fine in the v0407 build.

      To reproduce this problem requires the QA g_tpch2x tables. The problem is reproducible even on a workstation if the tables are populated on the workstation instance. The scripts to populate the tables are available upon request. (To use these scripts require DCS up and running, with a minimum of 3 mxosrvrs.)

      ----------------------------------------------------------
      Here is the statement to reproduce it.

      set schema g_tpch2x;

      prepare xx from
      select [last 0]
      c_custkey,
      c_name,
      sum(l_extendedprice * (1 - l_discount)) over (order by l_extendedprice
      rows between unbounded preceding and 4 preceding) as revenue,
      c_acctbal,
      n_name,
      c_address,
      c_phone,
      c_comment
      from
      customer,
      orders,
      lineitem,
      nation
      where
      c_custkey = o_custkey
      and l_orderkey = o_orderkey
      and o_orderdate >= date '1994-08-01'
      and o_orderdate < date '1994-08-01' + interval '3' month
      and l_returnflag = 'R'
      and c_nationkey = n_nationkey
      group by
      c_custkey,
      c_name,
      c_acctbal,
      c_phone,
      n_name,
      c_address,
      c_comment,
      l_extendedprice,
      l_discount
      order by
      revenue desc;

      ----------------------------------------------------------

      Here is the execution output:

      >>obey mytest1.sql;
      >>set schema g_tpch2x;

      — SQL operation complete.
      >>
      >>prepare xx from
      +>select [last 0]
      +>c_custkey,
      +>c_name,
      +>sum(l_extendedprice * (1 - l_discount)) over (order by l_extendedprice
      +>rows between unbounded preceding and 4 preceding) as revenue,
      +>c_acctbal,
      +>n_name,
      +>c_address,
      +>c_phone,
      +>c_comment
      +>from
      +>customer,
      +>orders,
      +>lineitem,
      +>nation
      +>where
      +>c_custkey = o_custkey
      +>and l_orderkey = o_orderkey
      +>and o_orderdate >= date '1994-08-01'
      +>and o_orderdate < date '1994-08-01' + interval '3' month
      +>and l_returnflag = 'R'
      +>and c_nationkey = n_nationkey
      +>group by
      +>c_custkey,
      +>c_name,
      +>c_acctbal,
      +>c_phone,
      +>n_name,
      +>c_address,
      +>c_comment,
      +>l_extendedprice,
      +>l_discount
      +>order by
      +>revenue desc;

          • WARNING[6007] Multi-column statistics for columns (C_CUSTKEY, C_NAME, C_ADDRESS, C_PHONE, C_ACCTBAL, C_COMMENT) from table TRAFODION.G_TPCH2X.CUSTOMER were not available. The columns were being used by GroupBy operator. As a result, the access path chosen might not be the best possible.
          • WARNING[6007] Multi-column statistics for columns (L_EXTENDEDPRICE, L_DISCOUNT) from table TRAFODION.G_TPCH2X.LINEITEM were not available. The columns were being used by GroupBy operator. As a result, the access path chosen might not be the best possible.
          • ERROR[7000] An internal error occurred in the code generator in file ../generator/GenItemFunc.cpp at line 1363: Not enough storage allocated for encode.
          • ERROR[2235] Compiler Internal Error: An unknown error, originated from file ../generator/Generator.cpp at line 2142.
          • ERROR[8822] The statement was not prepared.

      Attachments

        Activity

          People

            hzeller Hans Zeller
            WTsai Weishiun Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: