IMPALA-1185: Make Avro and Seq writers unsupported

Avro and Sequence writers are only available if query option
ALLOW_UNSUPPORTED_FORMATS is set to true, prints an error otherwise.

Change-Id: I597039f7c68f708fda10f848531eb557d6910f92
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4539
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
This commit is contained in:
Victor Bittorf
2014-09-25 12:55:03 -07:00
committed by Lenni Kuff
parent 72f9d50657
commit dbaf718221
4 changed files with 59 additions and 3 deletions

View File

@@ -16,10 +16,12 @@ TBLPROPERTIES ('avro.schema.literal'='{
====
---- QUERY
SET COMPRESSION_CODEC=NONE;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __avro_write select 0, "a", 1.1;
====
---- QUERY
SET COMPRESSION_CODEC=SNAPPY;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __avro_write select 1, "b", 2.2;
====
---- QUERY
@@ -31,5 +33,11 @@ select * from __avro_write;
INT,STRING,DOUBLE
====
---- QUERY
SET ALLOW_UNSUPPORTED_FORMATS=0;
insert into __avro_write select 1, "b", 2.2;
---- CATCH
Writing to table format AVRO is not supported. Use query option ALLOW_UNSUPPORTED_FORMATS
====
---- QUERY
drop table __avro_write;
====

View File

@@ -4,30 +4,42 @@ drop table if exists __seq_write;
====
---- QUERY
SET COMPRESSION_CODEC=NONE;
SET ALLOW_UNSUPPORTED_FORMATS=1;
create table __seq_write (i int, s string, d double)
stored as SEQUENCEFILE;
====
---- QUERY
SET COMPRESSION_CODEC=NONE;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __seq_write select 0, "a", 1.1;
====
---- QUERY
SET COMPRESSION_CODEC=DEFAULT;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __seq_write values (1, "b", 2.2);
====
---- QUERY
SET COMPRESSION_CODEC=SNAPPY;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __seq_write values (2, "c", 3.3);
====
---- QUERY
SET COMPRESSION_CODEC=SNAPPY_BLOCKED;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __seq_write values (3, "d", 4.4);
====
---- QUERY
SET COMPRESSION_CODEC=GZIP;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __seq_write values (4, "e", 5.5);
====
---- QUERY
SET ALLOW_UNSUPPORTED_FORMATS=0;
insert into __seq_write values (4, "e", 5.5);
---- CATCH
Writing to table format SEQUENCEFILE is not supported. Use query option
====
---- QUERY
select * from __seq_write;
---- RESULTS
0,'a',1.1

View File

@@ -7,21 +7,32 @@ create table __text_write (i int, s string, d double);
====
---- QUERY
SET COMPRESSION_CODEC=NONE;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __text_write select 0, "a", 1.1;
====
---- QUERY
SET COMPRESSION_CODEC=DEFAULT;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __text_write values (1, "b", 2.2);
====
---- QUERY
SET COMPRESSION_CODEC=SNAPPY;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __text_write values (2, "c", 3.3);
====
---- QUERY
SET COMPRESSION_CODEC=GZIP;
SET ALLOW_UNSUPPORTED_FORMATS=1;
insert into __text_write values (3, "d", 4.4);
====
---- QUERY
SET COMPRESSION_CODEC=GZIP;
SET ALLOW_UNSUPPORTED_FORMATS=0;
insert into __text_write values (3, "d", 4.4);
---- CATCH
Writing to compressed text table is not supported.
====
---- QUERY
select * from __text_write;
---- RESULTS
0,'a',1.1