hzxiongyinke opened a new pull request, #4651:
URL: https://github.com/apache/hive/pull/4651
… "Cannot connect to namenode"
### What changes were proposed in this pull request?
@Override
protected void analyzeCommand(TableName tableName, Map<String, String>
partitionSpec, ASTNode command)
throws SemanticException {
String newLocation = unescapeSQLString(command.getChild(0).getText());
try
{ // To make sure host/port pair is valid, the status of the location does
not matter FileSystem.get(new URI(newLocation), conf).getFileStatus(new
Path(newLocation)); }
catch (FileNotFoundException e)
{ // Only check host/port pair is valid, whether the file exist or not does
not matter }
catch (Exception e)
{ throw new SemanticException("Cannot connect to namenode, please check if
host/port pair for " + newLocation + " is valid", e); }
When the
"FileSystem.get(new URI(newLocation), conf).getFileStatus(new
Path(newLocation))"
code throws a "Permission denied" exception, the Beeline client will receive
the confusing exception "Cannot connect to namenode, please check if host/port
pair for". In reality, the issue is not with the namenode.
### Why are the changes needed?
Change AlterTableSetLocationAnalyzer Log
### Does this PR introduce _any_ user-facing change?
No
### Is the change a dependency upgrade?
No
### How was this patch tested?
No test need
--
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]