[
https://issues.apache.org/jira/browse/HIVE-23358?focusedWorklogId=468233&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-468233
]
ASF GitHub Bot logged work on HIVE-23358:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Aug/20 12:32
Start Date: 08/Aug/20 12:32
Worklog Time Spent: 10m
Work Description: sankarh commented on a change in pull request #1050:
URL: https://github.com/apache/hive/pull/1050#discussion_r467460705
##########
File path: ql/src/test/queries/clientpositive/msck_repair_7.q
##########
@@ -0,0 +1,71 @@
+DROP TABLE IF EXISTS repairtable_n7_1;
+DROP TABLE IF EXISTS repairtable_n7_2;
+DROP TABLE IF EXISTS repairtable_n7_3;
+DROP TABLE IF EXISTS repairtable_n7_4;
+DROP TABLE IF EXISTS repairtable_n7_5;
+DROP TABLE IF EXISTS repairtable_n7_6;
+DROP TABLE IF EXISTS repairtable_n7_7;
+DROP TABLE IF EXISTS repairtable_n7_8;
+
+CREATE EXTERNAL TABLE repairtable_n7_1(key INT) PARTITIONED BY (p1 TINYINT)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_1/';
+CREATE EXTERNAL TABLE repairtable_n7_2(key INT) PARTITIONED BY (p1 SMALLINT)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_2/';
+CREATE EXTERNAL TABLE repairtable_n7_3(key INT) PARTITIONED BY (p1 INT) stored
as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_3/';
+CREATE EXTERNAL TABLE repairtable_n7_4(key INT) PARTITIONED BY (p1 BIGINT)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_4/';
+CREATE EXTERNAL TABLE repairtable_n7_5(key INT) PARTITIONED BY (p1 FLOAT)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_5/';
+CREATE EXTERNAL TABLE repairtable_n7_6(key INT) PARTITIONED BY (p1 DOUBLE)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_6/';
+CREATE EXTERNAL TABLE repairtable_n7_7(key INT) PARTITIONED BY (p1
DECIMAL(10,10)) stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_7/';
+CREATE EXTERNAL TABLE repairtable_n7_8(key INT) PARTITIONED BY (p1 string)
stored as ORC location
'${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_8/';
+
+MSCK REPAIR TABLE repairtable_n7_1;
+MSCK REPAIR TABLE repairtable_n7_2;
+MSCK REPAIR TABLE repairtable_n7_3;
+MSCK REPAIR TABLE repairtable_n7_4;
+MSCK REPAIR TABLE repairtable_n7_5;
+MSCK REPAIR TABLE repairtable_n7_6;
+MSCK REPAIR TABLE repairtable_n7_7;
+MSCK REPAIR TABLE repairtable_n7_8;
+
+show partitions repairtable_n7_1;
+show partitions repairtable_n7_2;
+show partitions repairtable_n7_3;
+show partitions repairtable_n7_4;
+show partitions repairtable_n7_5;
+show partitions repairtable_n7_6;
+show partitions repairtable_n7_7;
+show partitions repairtable_n7_8;
+
+dfs ${system:test.dfs.mkdir} -p
${system:test.tmp.dir}/apps/hive/warehouse/test.db/repairtable_n7_1/p1=01;
Review comment:
Under each numeric table, add another partition dir with same value but
different number of preceding or following 0s. It should add only one partition
and point to just one directory. Not sure, what is the right behavior in this
case but should be well documented.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 468233)
Time Spent: 50m (was: 40m)
> MSCK REPAIR should remove all insignificant zeroes from partition values (for
> numeric datatypes) before creating the partitions
> -------------------------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-23358
> URL: https://issues.apache.org/jira/browse/HIVE-23358
> Project: Hive
> Issue Type: Bug
> Components: Standalone Metastore
> Affects Versions: 4.0.0
> Reporter: Adesh Kumar Rao
> Assignee: Adesh Kumar Rao
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> For the following scenario
> 1. Have partitioned data path as follows.
> hdfs://mycluster/datapath/t1/year=2020/month=03/day=10
> hdfs://mycluster/datapath/t1/year=2020/month=03/day=11
> 2. create external table t1 (key int, value string) partitioned by (Year int,
> Month int, Day int) stored as orc location hdfs://mycluster/datapath/t1'';
> 3. msck repair table t1;
> 4. show partitions t1;
> {noformat}
> +----------------------------+
> | partition |
> +----------------------------+
> | year=2020/month=03/day=10 |
> | year=2020/month=03/day=11 |
> +----------------------------+
> {noformat}
> 5.show table extended like 't1' partition (Year=2020, Month=03, Day=11);
> will throw an error:
> {noformat}
> Error: Error while compiling statement: FAILED: SemanticException [Error
> 10006]: Partition not found {year=2020, month=3, day=11}
> (state=42000,code=10006)
> {noformat}
> When the partition directory are created without the extra zeroes, this works
> fine.
> {noformat}
> hdfs://mycluster/datapath/t1/year=2020/month=3/day=10
> hdfs://mycluster/datapath/t1/year=2020/month=3/day=11
> {noformat}
> This happens because while searching for partitions, hive strips the extra
> "0" in month key and then queries the metastore
> (partSpec="year=2020/month=3/day=10") which returns no rows.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)