mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix checks
This commit is contained in:
parent
473903b396
commit
bb6bc61f22
@ -53,7 +53,7 @@ protected:
|
||||
ContextPtr context_);
|
||||
|
||||
StorageExternalDistributed(
|
||||
const String & uri,
|
||||
const String & addresses_description,
|
||||
const StorageID & table_id,
|
||||
const String & format_name,
|
||||
const std::optional<FormatSettings> & format_settings,
|
||||
|
@ -271,7 +271,7 @@ Pipe StorageURLWithFailover::read(
|
||||
ConnectionTimeouts::getHTTPTimeouts(local_context),
|
||||
chooseCompressionMethod(request_uri.getPath(), compression_method));
|
||||
|
||||
std::shuffle(uri_options.begin(), uri_options.begin(), thread_local_rng);
|
||||
std::shuffle(uri_options.begin(), uri_options.end(), thread_local_rng);
|
||||
|
||||
return Pipe(url_source);
|
||||
}
|
||||
@ -321,9 +321,9 @@ StorageURLWithFailover::StorageURLWithFailover(
|
||||
{
|
||||
for (const auto & uri_option : uri_options_)
|
||||
{
|
||||
Poco::URI uri(uri_option);
|
||||
context_->getRemoteHostFilter().checkURL(uri);
|
||||
uri_options.emplace_back(std::move(uri));
|
||||
Poco::URI uri_(uri_option);
|
||||
context_->getRemoteHostFilter().checkURL(uri_);
|
||||
uri_options.emplace_back(std::move(uri_));
|
||||
LOG_DEBUG(&Poco::Logger::get("StorageURLDistributed"), "Adding URL option: {}", uri_option);
|
||||
}
|
||||
}
|
||||
|
@ -26,44 +26,7 @@ def test_url_without_redirect(started_cluster):
|
||||
assert node1.query("select * from WebHDFSStorage") == "1\tMark\t72.53\n"
|
||||
|
||||
|
||||
def test_url_with_globs_1(started_cluster):
|
||||
query = "SELECT DISTINCT(users) FROM ("
|
||||
for i in range (10, 20):
|
||||
query += """
|
||||
SELECT DISTINCT(users) FROM
|
||||
(
|
||||
SELECT JSONExtractString(data, 'actor', 'login') AS users,
|
||||
JSONExtractString(data, 'payload', 'comment', 'body') AS body
|
||||
FROM url('https://data.gharchive.org/2020-11-11-{}.json.gz', TSV, 'data String')
|
||||
)
|
||||
UNION ALL
|
||||
""".format(i)
|
||||
|
||||
query += """
|
||||
SELECT DISTINCT(users) FROM
|
||||
(
|
||||
SELECT JSONExtractString(data, 'actor', 'login') AS users,
|
||||
JSONExtractString(data, 'payload', 'comment', 'body') AS body
|
||||
FROM url('https://data.gharchive.org/2020-11-11-20.json.gz', TSV, 'data String')
|
||||
)) ORDER BY users"""
|
||||
|
||||
expected = node1.query(query)
|
||||
|
||||
result = node1.query("""
|
||||
SELECT DISTINCT(users) FROM
|
||||
(
|
||||
SELECT JSONExtractString(data, 'actor', 'login') AS users,
|
||||
JSONExtractString(data, 'payload', 'comment', 'body') AS body
|
||||
FROM url('https://data.gharchive.org/2020-11-11-{10..20}.json.gz', TSV, 'data String')
|
||||
)
|
||||
ORDER BY users;
|
||||
""")
|
||||
|
||||
assert(result == expected)
|
||||
|
||||
|
||||
def test_url_with_globs_2(started_cluster):
|
||||
# 6 addresses
|
||||
def test_url_with_globs(started_cluster):
|
||||
started_cluster.hdfs_api.write_data("/simple_storage_1_1", "1\n")
|
||||
started_cluster.hdfs_api.write_data("/simple_storage_1_2", "2\n")
|
||||
started_cluster.hdfs_api.write_data("/simple_storage_1_3", "3\n")
|
||||
|
Loading…
Reference in New Issue
Block a user