mirror of
https://github.com/apache/impala.git
synced 2026-01-19 09:01:38 -05:00
In the BE we build partition names with the trailing char '/'. In the FE we build partition names without a trailing char. We should make this consistent because this causes some annoying string adjustments in the FE and can cause hidden bugs. This patch creates partition names without the trailing '/' both in the BE and the FE. This follows Hive's behavior that also prints partition names without the trailing '/'. Testing: * Ran exhaustive tests Change-Id: I7e40111e2d1148aeb01ebc985bbb15db7d6a6012 Reviewed-on: http://gerrit.cloudera.org:8080/16850 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
111 lines
2.5 KiB
Plaintext
111 lines
2.5 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Inserting into parquet table works.
|
|
insert into $DATABASE.parquet_date_tbl
|
|
values ('2011-05-06'), ('9999-12-31'), ('0001-01-01');
|
|
---- RESULTS
|
|
: 3
|
|
====
|
|
---- QUERY
|
|
# Querying parquet table written by Parquet-MR and Impala works.
|
|
select * from $DATABASE.parquet_date_tbl;
|
|
---- RESULTS
|
|
1970-02-12
|
|
1970-04-11
|
|
1972-09-27
|
|
2011-05-06
|
|
9999-12-31
|
|
0001-01-01
|
|
---- TYPES
|
|
DATE
|
|
====
|
|
---- QUERY
|
|
# Querying avro table is supported.
|
|
select * from $DATABASE.avro_date_tbl;
|
|
---- RESULTS
|
|
1970-01-01
|
|
1970-01-02
|
|
1224-05-19
|
|
8543-11-21
|
|
---- TYPES
|
|
DATE
|
|
====
|
|
---- QUERY
|
|
# Querying ORC table is supported.
|
|
select * from $DATABASE.orc_date_tbl;
|
|
---- TYPES
|
|
DATE
|
|
---- RESULTS
|
|
1970-06-12
|
|
2008-11-21
|
|
9999-12-31
|
|
NULL
|
|
====
|
|
---- QUERY
|
|
# Inserting text partitions to $DATABASE.date_tbl is OK.
|
|
insert into $DATABASE.date_tbl partition (date_part)
|
|
select date_col, date_part from functional.date_tbl;
|
|
---- RESULTS
|
|
date_part=0001-01-01: 7
|
|
date_part=1399-06-27: 3
|
|
date_part=2017-11-27: 10
|
|
date_part=9999-12-31: 2
|
|
====
|
|
---- QUERY
|
|
# Inserting into parquet partition is supported.
|
|
insert into $DATABASE.date_tbl partition(date_part='1899-12-31')
|
|
select date_col from functional_parquet.date_tbl where date_part = '1399-06-27';
|
|
---- RESULTS
|
|
date_part=1899-12-31: 3
|
|
====
|
|
---- QUERY
|
|
# Adding ORC partition works even though Impala cannot write ORC format.
|
|
# Querying all the partitions also works.
|
|
alter table $DATABASE.date_tbl add partition (date_part='2099-12-31')
|
|
location '$NAMENODE/test-warehouse/$DATABASE.db/orc_date_tbl';
|
|
alter table $DATABASE.date_tbl partition (date_part='2099-12-31') set fileformat orc;
|
|
select date_part, date_col from $DATABASE.date_tbl;
|
|
---- RESULTS
|
|
0001-01-01,0001-01-01
|
|
0001-01-01,0001-12-31
|
|
0001-01-01,0002-01-01
|
|
0001-01-01,1399-12-31
|
|
0001-01-01,2017-11-28
|
|
0001-01-01,9999-12-31
|
|
0001-01-01,NULL
|
|
1399-06-27,2017-11-28
|
|
1399-06-27,NULL
|
|
1399-06-27,2018-12-31
|
|
2017-11-27,0001-06-21
|
|
2017-11-27,0001-06-22
|
|
2017-11-27,0001-06-23
|
|
2017-11-27,0001-06-24
|
|
2017-11-27,0001-06-25
|
|
2017-11-27,0001-06-26
|
|
2017-11-27,0001-06-27
|
|
2017-11-27,0001-06-28
|
|
2017-11-27,0001-06-29
|
|
2017-11-27,2017-11-28
|
|
9999-12-31,9999-12-01
|
|
9999-12-31,9999-12-31
|
|
1899-12-31,1970-02-12
|
|
1899-12-31,1970-04-11
|
|
1899-12-31,1972-09-27
|
|
1899-12-31,2011-05-06
|
|
1899-12-31,9999-12-31
|
|
1899-12-31,0001-01-01
|
|
1899-12-31,2017-11-28
|
|
1899-12-31,NULL
|
|
1899-12-31,2018-12-31
|
|
1999-12-31,1970-01-01
|
|
1999-12-31,1970-01-02
|
|
1999-12-31,1224-05-19
|
|
1999-12-31,8543-11-21
|
|
2099-12-31,1970-06-12
|
|
2099-12-31,2008-11-21
|
|
2099-12-31,9999-12-31
|
|
2099-12-31,NULL
|
|
---- TYPES
|
|
DATE,DATE
|
|
====
|