Fix tests

This commit is contained in:
Alexey Milovidov 2024-08-04 00:24:17 +02:00
parent 6b300ab44f
commit a051eb2a5d
3 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ DatabaseHDFS::DatabaseHDFS(const String & name_, const String & source_url, Cont
if (!source.empty())
{
if (!re2::RE2::FullMatch(source, std::string(HDFS_HOST_REGEXP)))
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad hdfs host: {}. "
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad HDFS host: {}. "
"It should have structure 'hdfs://<host_name>:<port>'", source);
context_->getGlobalContext()->getRemoteHostFilter().checkURL(Poco::URI(source));

View File

@ -192,7 +192,7 @@ String getNameNodeCluster(const String &hdfs_url)
void checkHDFSURL(const String & url)
{
if (!re2::RE2::FullMatch(url, std::string(HDFS_URL_REGEXP)))
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad hdfs url: {}. It should have structure 'hdfs://<host_name>:<port>/<path>'", url);
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Bad HDFS URL: {}. It should have structure 'hdfs://<host_name>:<port>/<path>'", url);
}
}

View File

@ -157,7 +157,7 @@ def test_bad_hdfs_uri(started_cluster):
)
except Exception as ex:
print(ex)
assert "Bad hdfs url" in str(ex)
assert "Bad HDFS URL" in str(ex)
try:
node1.query(
"create table BadStorage2 (id UInt32, name String, weight Float64) ENGINE = HDFS('hdfs://hdfs100500:9000/other_storage', 'TSV')"