Add scanner test case for scenario where data and table schema do not match

Change-Id: I16f007ad1cb2caac47506914512c5665fc3d5f56
Reviewed-on: http://gerrit.ent.cloudera.com:8080/98
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: Lenni Kuff <lskuff@cloudera.com>
This commit is contained in:
Lenni Kuff
2013-07-30 15:30:27 -07:00
committed by Henry Robinson
parent 69836f8ef4
commit faeb7f5fa3
4 changed files with 218 additions and 1 deletions

View File

@@ -0,0 +1,153 @@
# Test case to verify the scanners work properly when the table metadata (specifically the
# number of columns in the table) does not match the number of columns in the data file.
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611,5000
1002,'Name2',94611,5000
1003,'Name3',94611,5000
1004,'Name4',94611,5000
1005,'Name5',94611,5000
1106,'Name6',94612,5000
1006,'Name16',94612,5000
1006,'Name6',94616,5000
1106,'Name16',94612,5000
1106,'Name6',94616,5000
1006,'Name16',94616,5000
1106,'Name16',94616,5000
1106,'Name6',94612,15000
1006,'Name16',94612,15000
1006,'Name6',94616,15000
1106,'Name16',94612,15000
1106,'Name6',94616,15000
1006,'Name16',94616,15000
1106,'Name16',94616,15000
---- TYPES
BIGINT, STRING, INT, INT
====
---- QUERY
alter table jointbl_test add columns(new_col string)
---- RESULTS
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611,5000,''
1002,'Name2',94611,5000,''
1003,'Name3',94611,5000,''
1004,'Name4',94611,5000,''
1005,'Name5',94611,5000,''
1106,'Name6',94612,5000,''
1006,'Name16',94612,5000,''
1006,'Name6',94616,5000,''
1106,'Name16',94612,5000,''
1106,'Name6',94616,5000,''
1006,'Name16',94616,5000,''
1106,'Name16',94616,5000,''
1106,'Name6',94612,15000,''
1006,'Name16',94612,15000,''
1006,'Name6',94616,15000,''
1106,'Name16',94612,15000,''
1106,'Name6',94616,15000,''
1006,'Name16',94616,15000,''
1106,'Name16',94616,15000,''
---- TYPES
BIGINT, STRING, INT, INT, STRING
====
---- QUERY
alter table jointbl_test add columns(new_int_col int)
---- RESULTS
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611,5000,'',NULL
1002,'Name2',94611,5000,'',NULL
1003,'Name3',94611,5000,'',NULL
1004,'Name4',94611,5000,'',NULL
1005,'Name5',94611,5000,'',NULL
1106,'Name6',94612,5000,'',NULL
1006,'Name16',94612,5000,'',NULL
1006,'Name6',94616,5000,'',NULL
1106,'Name16',94612,5000,'',NULL
1106,'Name6',94616,5000,'',NULL
1006,'Name16',94616,5000,'',NULL
1106,'Name16',94616,5000,'',NULL
1106,'Name6',94612,15000,'',NULL
1006,'Name16',94612,15000,'',NULL
1006,'Name6',94616,15000,'',NULL
1106,'Name16',94612,15000,'',NULL
1106,'Name6',94616,15000,'',NULL
1006,'Name16',94616,15000,'',NULL
1106,'Name16',94616,15000,'',NULL
---- TYPES
BIGINT, STRING, INT, INT, STRING, INT
====
---- QUERY
alter table jointbl_test drop column new_int_col
---- RESULTS
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611,5000,''
1002,'Name2',94611,5000,''
1003,'Name3',94611,5000,''
1004,'Name4',94611,5000,''
1005,'Name5',94611,5000,''
1106,'Name6',94612,5000,''
1006,'Name16',94612,5000,''
1006,'Name6',94616,5000,''
1106,'Name16',94612,5000,''
1106,'Name6',94616,5000,''
1006,'Name16',94616,5000,''
1106,'Name16',94616,5000,''
1106,'Name6',94612,15000,''
1006,'Name16',94612,15000,''
1006,'Name6',94616,15000,''
1106,'Name16',94612,15000,''
1106,'Name6',94616,15000,''
1006,'Name16',94616,15000,''
1106,'Name16',94616,15000,''
---- TYPES
BIGINT, STRING, INT, INT, STRING
====
---- QUERY
alter table jointbl_test drop column new_col
---- RESULTS
====
---- QUERY
alter table jointbl_test drop column alltypes_id
---- RESULTS
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611
1002,'Name2',94611
1003,'Name3',94611
1004,'Name4',94611
1005,'Name5',94611
1106,'Name6',94612
1006,'Name16',94612
1006,'Name6',94616
1106,'Name16',94612
1106,'Name6',94616
1006,'Name16',94616
1106,'Name16',94616
1106,'Name6',94612
1006,'Name16',94612
1006,'Name6',94616
1106,'Name16',94612
1106,'Name6',94616
1006,'Name16',94616
1106,'Name16',94616
---- TYPES
BIGINT, STRING, INT
====