Files
impala/testdata/workloads/functional-query/queries/QueryTest/test-unmatched-schema.test
Tim Armstrong bc8c55afcd IMPALA-3729: batch_size=1 coverage for avro scanner
Also fix a stale comment in the avro scanner header.

The main work here is to fix the handling of empty result sets in the
test result verifier. This is a problem because we wanted to verify
that the results in the test file were a superset of the rows
returned, and this was thrown off by superflous '' rows in the expected
and actual result sets.

The basic problem is that the way test file sections
was parsed conflated an empty result section with non-empty result
section that had a single empty string. I.e.:

---- RESULTS
====

vs
---- RESULTS

====

both got resolved to [''].

Change-Id: Ia007e558d92c7e4ce30be90446fdbb1f50a0ebc4
Reviewed-on: http://gerrit.cloudera.org:8080/3413
Tested-by: Internal Jenkins
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
2016-07-19 23:30:02 -07:00

149 lines
3.7 KiB
Plaintext

# 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,'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
====
---- QUERY
alter table jointbl_test add columns(new_int_col int)
---- RESULTS
====
---- QUERY
select * from jointbl_test
---- RESULTS
1001,'Name1',94611,5000,'NULL',NULL
1002,'Name2',94611,5000,'NULL',NULL
1003,'Name3',94611,5000,'NULL',NULL
1004,'Name4',94611,5000,'NULL',NULL
1005,'Name5',94611,5000,'NULL',NULL
1106,'Name6',94612,5000,'NULL',NULL
1006,'Name16',94612,5000,'NULL',NULL
1006,'Name6',94616,5000,'NULL',NULL
1106,'Name16',94612,5000,'NULL',NULL
1106,'Name6',94616,5000,'NULL',NULL
1006,'Name16',94616,5000,'NULL',NULL
1106,'Name16',94616,5000,'NULL',NULL
1106,'Name6',94612,15000,'NULL',NULL
1006,'Name16',94612,15000,'NULL',NULL
1006,'Name6',94616,15000,'NULL',NULL
1106,'Name16',94612,15000,'NULL',NULL
1106,'Name6',94616,15000,'NULL',NULL
1006,'Name16',94616,15000,'NULL',NULL
1106,'Name16',94616,15000,'NULL',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,'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
====
---- 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
====