Aggarwal-Raghav commented on code in PR #5568:
URL: https://github.com/apache/hive/pull/5568#discussion_r1874930571
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreChecker.java:
##########
@@ -440,12 +440,13 @@ void findUnknownPartitions(Table table, Set<Path>
missingPartDirs,
partColNames.add(fSchema.getName());
}
+ String defaultPartName = MetastoreConf.getVar(conf,
MetastoreConf.ConfVars.DEFAULTPARTITIONNAME);
Review Comment:
**Yes, that case the solution won't work.**
But IMO, its user's responsibility to create the default partition of same
type as that of the partition column type and ensure no other datatype
partition column is present.
Consider 2 scenarios where partition column is of **INT** type:
**Scenario1:**
User1 sets default partition conf value to "ANOTHER_PARTITION" and user 2 in
another beeline session tries to insert data in default partition, then hdfs
dir structure will look something like this:
```
path to table/part=ANOTHER_PARITION
path to table/part=__HIVE_DEFAULT_PARTITION__
```
and running msck repair will never succeed for any user. One user will get
this
```
Caused by: java.lang.NumberFormatException: For input string:
"ANOTHER_PARITION"
```
and other will get this
```
Caused by: java.lang.NumberFormatException: For input string:
"__HIVE_DEFAULT_PARTITION__"
```
**Scenario2:**
User set default partition conf value to INT. Lets say 13, so hdfs dir
structure looks like this
```
path to table/part=13
path to table/part=__HIVE_DEFAULT_PARTITION__
```
and in same session user creates a new table pointing of location of old
table and run msck repair then it will fail for \_\_HIVE_DEFAULT_PARTITION__.
Unless the user change the config back to \_\_HIVE_DEFAULT_PARTITION__
**Questions that I also have**, is going forward what should be the expected
behaviour? That the user has to ensure that there shouldn't be 2 partitions of
different datatype than that of partition column as shown in scenario 1?
CC @ayushtkn @deniskuzZ -- please provide your insights on this?
Also, there are multiple places where \_\_HIVE_DEFAULT_PARTITION__ is
explicitly used instead of the config value. For instance here:
https://github.com/apache/hive/blob/c27d31722c2a7426f3236d3d892dbe1e206e840d/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FileUtils.java#L307
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]