blob: 4c83643a5a0334896015faf6f912d5e25e460d50 [file] [log] [blame]
set datestyle = 'ISO, DMY';
-- Using double quote for source file location
-- system correctly fails the create operation
-- and shows the correct syntax error message
DROP EXTERNAL TABLE IF EXISTS tbl_ext_fixedwidth;
CREATE READABLE EXTERNAL TABLE tbl_ext_fixedwidth (
s1 char(10), s2 varchar(10), s3 text, dt timestamp,
n1 smallint, n2 integer, n3 bigint, n4 decimal,
n5 numeric, n6 real, n7 double precision)
LOCATION ("file://path/doesnt/path/doesnt/matter.tbl")
FORMAT 'CUSTOM' (formatter='fixedwidth_in', s1='10',
s2='10', s3='10', dt='20',n1='5', n2='10',
n3='10', n4='10', n5='10', n6='10', n7='15');
-- Using double quote for CUSTOM format keyword
-- system correctly fails the create operation
-- and shows the correct syntax error message
DROP EXTERNAL TABLE IF EXISTS tbl_ext_fixedwidth;
CREATE READABLE EXTERNAL TABLE tbl_ext_fixedwidth (
s1 char(10), s2 varchar(10), s3 text, dt timestamp,
n1 smallint, n2 integer, n3 bigint, n4 decimal,
n5 numeric, n6 real, n7 double precision)
LOCATION ('file://@hostname@@abs_srcdir@/data/fixedwidth_small_correct.tbl')
FORMAT "CUSTOM" (formatter='fixedwidth_in', s1='10',
s2='10', s3='10', dt='20',n1='5', n2='10',
n3='10', n4='10', n5='10', n6='10', n7='15');
-- Can successfully create the external table
-- with values in Field Locations doubled quoted
DROP EXTERNAL TABLE IF EXISTS tbl_ext_fixedwidth;
CREATE READABLE EXTERNAL TABLE tbl_ext_fixedwidth (
s1 char(10), s2 varchar(10), s3 text, dt timestamp,
n1 smallint, n2 integer, n3 bigint, n4 decimal,
n5 numeric, n6 real, n7 double precision)
LOCATION ('file://@hostname@@abs_srcdir@/data/fixedwidth_small_correct.tbl')
FORMAT 'CUSTOM' (formatter="fixedwidth_in", s1="10",
s2="10", s3="10", dt="20",n1="5", n2="10",
n3="10", n4="10", n5="10", n6="10", n7="15");
SELECT * FROM tbl_ext_fixedwidth ORDER BY s1;