You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ayush Saxena (Jira)" <ji...@apache.org> on 2023/09/17 13:17:00 UTC
[jira] [Resolved] (HIVE-27664) AlterTableSetLocationAnalyzer threw a confusing exception "Cannot connect to namenode"
[ https://issues.apache.org/jira/browse/HIVE-27664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ayush Saxena resolved HIVE-27664.
---------------------------------
Fix Version/s: 4.0.0
Resolution: Fixed
> 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
> Labels: pull-request-available
> Fix For: 4.0.0
>
>
> @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)