提交 905bce4a 编写于 作者: A Alexander Tokmakov

fix

上级 f099ce19
......@@ -227,7 +227,11 @@ set(uv_test_sources
# list(APPEND uv_test_libraries ws2_32)
# list(APPEND uv_test_sources src/win/snprintf.c test/runner-win.c)
#else()
list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
list(APPEND uv_defines _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
# Android has pthread as part of its c library, not as a separate
# libpthread.so.
......
# include <Common/config.h>
# include <Columns/ColumnNullable.h>
# include <Columns/ColumnString.h>
# include <Columns/ColumnsNumber.h>
# include <Core/ExternalResultDescription.h>
# include <Columns/ColumnString.h>
# include <IO/ReadHelpers.h>
#if !defined(ARCADIA_BUILD)
#include <Common/config.h>
#endif
#if USE_CASSANDRA
# include <utility>
# include "CassandraBlockInputStream.h"
# include "CassandraBlockInputStream.h"
#include <utility>
#include <Columns/ColumnNullable.h>
#include <Columns/ColumnString.h>
#include <Columns/ColumnsNumber.h>
#include <Core/ExternalResultDescription.h>
#include <Columns/ColumnString.h>
#include <IO/ReadHelpers.h>
#include "CassandraBlockInputStream.h"
namespace DB
......
......@@ -13,19 +13,16 @@ namespace DB
void registerDictionarySourceCassandra(DictionarySourceFactory & factory)
{
auto create_table_source = [=](const DictionaryStructure & dict_struct,
const Poco::Util::AbstractConfiguration & config,
const std::string & config_prefix,
Block & sample_block,
const Context & /* context */,
bool /*check_config*/) -> DictionarySourcePtr {
auto create_table_source = [=]([[maybe_unused]] const DictionaryStructure & dict_struct,
[[maybe_unused]] const Poco::Util::AbstractConfiguration & config,
[[maybe_unused]] const std::string & config_prefix,
[[maybe_unused]] Block & sample_block,
const Context & /* context */,
bool /*check_config*/) -> DictionarySourcePtr
{
#if USE_CASSANDRA
return std::make_unique<CassandraDictionarySource>(dict_struct, config, config_prefix + ".cassandra", sample_block);
#else
(void)dict_struct;
(void)config;
(void)config_prefix;
(void)sample_block;
throw Exception{"Dictionary source of type `cassandra` is disabled because library was built without cassandra support.",
ErrorCodes::SUPPORT_IS_DISABLED};
#endif
......@@ -37,9 +34,9 @@ namespace DB
#if USE_CASSANDRA
# include <cassandra.h>
# include <IO/WriteHelpers.h>
# include "CassandraBlockInputStream.h"
#include <cassandra.h>
#include <IO/WriteHelpers.h>
#include "CassandraBlockInputStream.h"
namespace DB
{
......
......@@ -465,11 +465,11 @@ class ClickHouseCluster:
start = time.time()
while time.time() - start < timeout:
try:
cass_client.connect().execute("drop keyspace if exists test;")
logging.info("Connected to Cassandra %s")
cass_client.connect()
logging.info("Connected to Cassandra")
return
except Exception as ex:
logging.warning("Can't connect to Minio: %s", str(ex))
logging.warning("Can't connect to Cassandra: %s", str(ex))
time.sleep(1)
def start(self, destroy_dirs=True):
......
......@@ -447,6 +447,7 @@ class SourceCassandra(ExternalSource):
self.client = cassandra.cluster.Cluster([self.internal_hostname], port=self.internal_port)
self.session = self.client.connect()
self.session.execute("create keyspace if not exists test with replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};")
self.session.execute('drop table if exists test."{}"'.format(table_name))
self.structure[table_name] = structure
columns = ['"' + col.name + '" ' + self.TYPE_MAPPING[col.field_type] for col in structure.get_all_fields()]
keys = ['"' + col.name + '"' for col in structure.keys]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册