You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Lili Ma (JIRA)" <ji...@apache.org> on 2016/11/21 11:02:58 UTC

[jira] [Created] (HAWQ-1167) Parquet format table estimate column width meets error for bpchar type

Lili Ma created HAWQ-1167:
-----------------------------

             Summary: Parquet format table estimate column width meets error for bpchar type
                 Key: HAWQ-1167
                 URL: https://issues.apache.org/jira/browse/HAWQ-1167
             Project: Apache HAWQ
          Issue Type: Bug
          Components: Storage
            Reporter: Lili Ma
            Assignee: Lei Chang


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.
{code}
		case HAWQ_TYPE_BPCHAR:
			/* for char(n), atttypmod is n + 4 */
			Assert(att->atttypmod > 4);
			columnWidths[(*colidx)++] = att->atttypmod;
{code}
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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)