[hive] After Flink changed the table name when using hive metastore, the modified table could not be found.#1833
Conversation
…ified table could not be found.
| Path fromPath = getDataTableLocation(fromTable); | ||
| Path toPath = getDataTableLocation(toTable); | ||
| try { | ||
| fileIO.rename(fromPath, toPath); |
There was a problem hiding this comment.
Maybe check fromPath existence first? Maybe hive will do this renaming before.
There was a problem hiding this comment.
When hive renames a table, it only modifies the metadata and does not modify the value of the location url. Is it necessary to check fromPath and toPath here?
There was a problem hiding this comment.
You can see discussion in #471 .
Some Hive version maybe rename the directory to new. So we can add this check first.
Or can you confirm all Hive versions do not rename the directory?
There was a problem hiding this comment.
We are fixing this bug, so I know there is the problem.
There was a problem hiding this comment.
The birth of this bug is because the codes did not perform a minimum protection action, which I suggested in PR.
|
I test again in hive3.1.3, it is correct. that is very strange |
|
We need to confirm if the user is using object storage. I remember this situation occurred once when I was using s3. In addition, I think we may need more user environment information to troubleshoot the issue |
|
I test in s3 with hive catalog , the table could no be found after rename table |
|
Thanks @zhangjun0x01 @JingsongLi I suggest that at the code layer, first execute the hive client alert_table method to rename, then check fromPath, if it exists, call fileIO rename, and update hive location. What do you think? @JingsongLi @zhangjun0x01 |
I think it is ok, add a check to ensure that the location is correctly renamed |
JingsongLi
left a comment
There was a problem hiding this comment.
+1 Thanks @zhuangchong


…
Purpose
Linked issue: close #1831
Tests
HiveCatalogITCaseBase#testRenameTable
API and Format
Documentation