[ https://issues.apache.org/jira/browse/HIVE-28654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ayush Saxena updated HIVE-28654: -------------------------------- Reporter: chiranjeevi (was: Raghav Aggarwal) > MSCK repair fails for default partition when partition column is of numeric > type > -------------------------------------------------------------------------------- > > Key: HIVE-28654 > URL: https://issues.apache.org/jira/browse/HIVE-28654 > Project: Hive > Issue Type: Bug > Reporter: chiranjeevi > Assignee: Raghav Aggarwal > Priority: Major > Labels: pull-request-available > Fix For: 4.1.0 > > > Running msck repair when partition column is of numeric type and a default > partition is present (__HIVE_DEFAULT_PARTITION__) then msck repair fails with > the following stacktrace. > {code:java} > 2024-12-02 22:17:30,338 ERROR operation.SQLOperation: Error running hive query > org.apache.hive.service.cli.HiveSQLException: Error while compiling > statement: FAILED: Execution Error, return code 40000 from > org.apache.hadoop.hive.ql.ddl.DDLTask. For input string: > "__HIVE_DEFAULT_PARTITION__"; Query ID: > raghav_20241202221730_e80f5ee6-dbc6-4241-8302-e76a52ebc75b > at > org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:376) > at > org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:247) > at > org.apache.hive.service.cli.operation.SQLOperation.access$500(SQLOperation.java:88) > at > org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:334) > at java.security.AccessController.doPrivileged(Native Method) > at javax.security.auth.Subject.doAs(Subject.java:422) > at > org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899) > at > org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:354) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:750) > Caused by: java.lang.NumberFormatException: For input string: > "__HIVE_DEFAULT_PARTITION__" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) > at java.lang.Integer.parseInt(Integer.java:580) > at java.lang.Integer.parseInt(Integer.java:615) > at > org.apache.hadoop.hive.metastore.utils.MetaStoreServerUtils.getNormalisedPartitionValue(MetaStoreServerUtils.java:1644) > at > org.apache.hadoop.hive.metastore.utils.MetaStoreServerUtils.getPartitionName(MetaStoreServerUtils.java:1623) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreChecker.findUnknownPartitions(HiveMetaStoreChecker.java:447) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreChecker.checkTable(HiveMetaStoreChecker.java:405) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreChecker.checkTable(HiveMetaStoreChecker.java:290) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreChecker.checkMetastore(HiveMetaStoreChecker.java:164) > at org.apache.hadoop.hive.metastore.Msck.repair(Msck.java:144) > at > org.apache.hadoop.hive.ql.ddl.misc.msck.MsckOperation.execute(MsckOperation.java:78) > at org.apache.hadoop.hive.ql.ddl.DDLTask.execute(DDLTask.java:84) > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:214) > at > org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105) > at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:354) > at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:327) > at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:244) > at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:105) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:346) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:190) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:143) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:138) > at > org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:190) > at > org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:234) > ... 11 more > {code} > Here are steps to reproduce the issue and also wrote 2 q files for same. > Present in the PR: > {code:java} > create database raghav; > use raghav; > create table t1 (id int, name string) partitioned by (month int, day int) > stored as orc; > insert into t1 values(1, 'aaa', 11, 2); > insert into t1 values(2, 'bbb', 12, 3); > insert into t1 (id, name, month) values(3, 'ccc', 12); > select * from t1; > --create t2 table as same location of table t1 > create table t2 (id int, name string) partitioned by (month int, day int) > stored as orc LOCATION > 'hdfs://localhost:9000/user/hive/warehouse/raghav.db/t1'; > msck repair table t2; {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)