[
https://issues.apache.org/jira/browse/HIVE-27664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17761913#comment-17761913
]
xiongyinke commented on HIVE-27664:
-----------------------------------
[~daijy] Hi daijy ,could you help me take a look at this?
The PR is https://github.com/apache/hive/pull/4651 .
Best wishes!
> AlterTableSetLocationAnalyzer threw a confusing exception "Cannot connect to
> namenode"
> --------------------------------------------------------------------------------------
>
> Key: HIVE-27664
> URL: https://issues.apache.org/jira/browse/HIVE-27664
> Project: Hive
> Issue Type: Improvement
> Affects Versions: 4.0.0-beta-1
> Reporter: xiongyinke
> Assignee: xiongyinke
> Priority: Major
>
> @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.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)