| -- When field length of s1 is 10, which is less than its defined column length char(20) |
| DROP EXTERNAL TABLE IF EXISTS tbl_ext_fixedwidth; |
| CREATE READABLE EXTERNAL TABLE tbl_ext_fixedwidth ( |
| s1 char(20), s2 varchar(20), s3 text, |
| col_empty character(5),col_null character varying(5) ) |
| LOCATION ('file://@hostname@@abs_srcdir@/data/fixedwidth_null.tbl') |
| FORMAT 'CUSTOM' (formatter='fixedwidth_in', |
| s1='10',s2='10', s3='10', col_empty='5', col_null='5'); |
| |
| -- query ext table can return correct results |
| select * from tbl_ext_fixedwidth; |
| |
| -- When field length of s1 is 10, which is greater than its defined column length char(5) |
| DROP EXTERNAL TABLE IF EXISTS tbl_ext_fixedwidth; |
| CREATE READABLE EXTERNAL TABLE tbl_ext_fixedwidth ( |
| s1 char(5), s2 varchar(5), s3 text, |
| col_empty character(5),col_null character varying(5) ) |
| LOCATION ('file://@hostname@@abs_srcdir@/data/fixedwidth_null.tbl') |
| FORMAT 'CUSTOM' (formatter='fixedwidth_in', |
| s1='10',s2='10', s3='10', col_empty='5', col_null='5'); |
| |
| -- query ext table correctly show the error message |
| select * from tbl_ext_fixedwidth order by s1; |