| -- start_ignore |
| SET SEARCH_PATH=TestExtOrc_TestNormalPath; |
| SET |
| -- end_ignore |
| -- inter table |
| -- start_ignore |
| drop table if exists normal_orctable1, normal_orctable2, normal_orctable3, normal_orctable4, normal_orctable5; |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:6: NOTICE: table "normal_orctable1" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:6: NOTICE: table "normal_orctable2" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:6: NOTICE: table "normal_orctable3" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:6: NOTICE: table "normal_orctable4" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:6: NOTICE: table "normal_orctable5" does not exist, skipping |
| DROP TABLE |
| drop external table if exists normal_orctable1_e, normal_orctable2_e, normal_orctable3_e, normal_orctable4_e, normal_orctable5_e, normal_orctable6_e, normal_orctable7_e, normal_orctable8_e; |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable1_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable2_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable3_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable4_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable5_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable6_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable7_e" does not exist, skipping |
| psql:/tmp/TestExtOrc_TestNormalPath.sql:7: NOTICE: table "normal_orctable8_e" does not exist, skipping |
| DROP EXTERNAL TABLE |
| -- end_ignore |
| -- create normal table |
| create table normal_orctable1 (i int, j float) format 'orc'; |
| CREATE TABLE |
| create table normal_orctable2 (i int, j float) format 'orc' encoding 'utf8'; |
| CREATE TABLE |
| create table normal_orctable3 (i int, j float) format 'orc' (compresstype 'snappy') encoding 'utf8'; |
| CREATE TABLE |
| create table normal_orctable4 (i int, j float) format 'orc' (compresstype 'none') encoding 'utf8'; |
| CREATE TABLE |
| create table normal_orctable5 (i int, j float) format 'orc' (compresstype 'lz4') encoding 'utf8'; |
| CREATE TABLE |
| create table normal_orctable6 (k text, like normal_orctable1) format 'orc'; |
| CREATE TABLE |
| create table normal_orctable7 (i int, j float) format 'orc' distributed by (i); |
| CREATE TABLE |
| -- writable external orc table |
| create writable external table normal_orctable1_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable1_e') format 'orc'; |
| CREATE EXTERNAL TABLE |
| create writable external table normal_orctable2_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable2_e') format 'orc' encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| create writable external table normal_orctable3_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable3_e') format 'orc' () encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| create writable external table normal_orctable4_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable4_e') format 'orc' (compresstype 'snappy') encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| create writable external table normal_orctable5_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable5_e') format 'orc' (compresstype 'none') encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| create writable external table normal_orctable6_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable6_e') format 'orc' (compresstype 'lz4') encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| -- readable external orc table |
| create readable external table normal_orctable7_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable7_e') format 'orc'; |
| CREATE EXTERNAL TABLE |
| create readable external table normal_orctable8_e (i int, j float) location ('hdfs://localhost:8020/hawq_default/exttable_extorc_test_normalpath/normal_orctable8_e') format 'orc' encoding 'utf8'; |
| CREATE EXTERNAL TABLE |
| -- test insert |
| insert into normal_orctable1 values (1,0.1); |
| INSERT 0 1 |
| insert into normal_orctable1 values (2,0.1); |
| INSERT 0 1 |
| insert into normal_orctable1 values (3,0.1); |
| INSERT 0 1 |
| select * from normal_orctable1; |
| i | j |
| ---+----- |
| 1 | 0.1 |
| 2 | 0.1 |
| 3 | 0.1 |
| (3 rows) |
| |
| insert into normal_orctable1_e values (1,0.1); |
| INSERT 0 1 |
| insert into normal_orctable1_e values (2,0.1); |
| INSERT 0 1 |
| insert into normal_orctable1_e values (3,0.1); |
| INSERT 0 1 |
| select * from normal_orctable1_e; |
| i | j |
| ---+----- |
| 1 | 0.1 |
| 2 | 0.1 |
| 3 | 0.1 |
| (3 rows) |
| |
| select c.relname, e.fmttype, e.fmtopts, e.command, e.rejectlimit, e.rejectlimittype, e.fmterrtbl, e.encoding, e.writable |
| from pg_class c, pg_exttable e |
| where c.oid=e.reloid and c.relname in ('normal_orctable1_e', 'normal_orctable2_e', 'normal_orctable3_e', 'normal_orctable4_e', 'normal_orctable5_e', 'normal_orctable6_e', 'normal_orctable7_e', 'normal_orctable8_e') |
| order by c.relname; |
| relname | fmttype | fmtopts | command | rejectlimit | rejectlimittype | fmterrtbl | encoding | writable |
| --------------------+---------+------------------------------------------------------------+---------+-------------+-----------------+-----------+----------+---------- |
| normal_orctable1_e | b | formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable2_e | b | formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable3_e | b | formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable4_e | b | compresstype 'snappy' formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable5_e | b | compresstype 'none' formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable6_e | b | compresstype 'lz4' formatter 'orc' category 'external' | | | | | 6 | t |
| normal_orctable7_e | b | formatter 'orc' category 'external' | | | | | 6 | f |
| normal_orctable8_e | b | formatter 'orc' category 'external' | | | | | 6 | f |
| (8 rows) |
| |
| -- test drop |