vikramahuja1001 commented on code in PR #5976:
URL: https://github.com/apache/hive/pull/5976#discussion_r2232818285


##########
ql/src/test/results/clientpositive/llap/msck_repair_9.q.out:
##########
@@ -90,7 +90,7 @@ PREHOOK: Output: default@tbl_y
 POSTHOOK: query: MSCK REPAIR TABLE tbl_y
 POSTHOOK: type: MSCK
 POSTHOOK: Output: default@tbl_y
-Partitions not in metastore:   tbl_y:month=12/day=2    tbl_y:month=12/day=3    
tbl_y:month=12/day=__HIVE_DEFAULT_PARTITION__   
tbl_y:month=ANOTHER_PARTITION/day=3
+Partitions not in metastore:   tbl_y:month=12/day=2    tbl_y:month=12/day=3    
tbl_y:month=ANOTHER_PARTITION/day=3

Review Comment:
   @deniskuzZ, in the above scenario that you described:
   `INSERT INTO tbl_x (id, name, month) values(3, 'ccc', 12);` -> 
PARTITION(month=12,day=HIVE_DEFAULT_PARTITION)
   `SET hive.exec.default.partition.name=ANOTHER_PARTITION;`
   `INSERT INTO tbl_x (id, name, day) values(4, 'ddd', 3);` -> 
PARTITION(month=ANOTHER_PARTITION,day=3)
   `MSCK REPAIR TABLE tbl_x;`
   
   hive.exec.default.partition.name is an exactly one value. So at one point of 
time only one one value is valid, rest all the other values are invalid. So 
when MSCK repair is ran , `hive.exec.default.partition.name` has been already 
set to `ANOTHER_PARTITION` which makes the  HIVE_DEFAULT_PARTITION not a valid 
partition anymore.
   
   Since by default `hive.msck.path.validation` is set to `throw`,  msck repair 
will throw an exception as it encounters a invalid partition 
(month=12,day=HIVE_DEFAULT_PARTITION) and will fail the whole operation without 
adding any new partition to the HMS with the exception: `Invalid partition 
value: Cannot parse HIVE_DEFAULT_PARTITION as type int. Failing MSCK. Set 
hive.msck.path.validation=skip to ignore invalid partitions` 
   
   But when the user sets `hive.msck.path.validation=skip` at  the session 
level, msck repair operation will succeed but it will skip all the invalid 
partitions by adding a warning log (month=12,day=HIVE_DEFAULT_PARTITION in this 
case) and will only add the valid partitions in that 
case((month=ANOTHER_PARTITION,day=3).
   
   



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to