Files
impala/testdata/workloads/functional-query/queries/QueryTest/avro-writer.test
Victor Bittorf dbaf718221 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
2014-09-26 12:28:03 -07:00

44 lines
1.1 KiB
Plaintext

====
---- QUERY
drop table if exists __avro_write;
====
---- QUERY
SET COMPRESSION_CODEC=NONE;
create table __avro_write (i int, s string, d double)
stored as AVRO
TBLPROPERTIES ('avro.schema.literal'='{
"name": "my_record",
"type": "record",
"fields": [
{"name":"i", "type":["int", "null"]},
{"name":"s", "type":["string", "null"]},
{"name":"d", "type":["double", "null"]}]}');
====
---- 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
select * from __avro_write;
---- RESULTS
0,'a',1.1
1,'b',2.2
---- TYPES
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;
====