Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-1167

Parquet format table estimate column width meets error for bpchar type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0.0-incubating
    • Storage
    • None

    Description

      In function estimateColumnWidth, the atttypmod attribute for type bpchar may be -1, and will provide wrong value to columnWidths. Should estimate a valid length for any type.

      		case HAWQ_TYPE_BPCHAR:
      			/* for char(n), atttypmod is n + 4 */
      			Assert(att->atttypmod > 4);
      			columnWidths[(*colidx)++] = att->atttypmod;
      

      Reproduce type:
      1. create table A(a int, b bpchar);
      2. select oid from pg_class where relname='a';
      3. select attname, atttypmod from pg_attribute where attrelid=$oid

      will see the atttypmod is -1, thus will bring error.

      Attachments

        Issue Links

          Activity

            People

              xunzhang Hong Wu
              lilima Lili Ma
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: