diff --git a/src/DataTypes/tests/CMakeLists.txt b/src/DataTypes/tests/CMakeLists.txt index e56dd166ea3..e69de29bb2d 100644 --- a/src/DataTypes/tests/CMakeLists.txt +++ b/src/DataTypes/tests/CMakeLists.txt @@ -1,5 +0,0 @@ -add_executable (data_types_number_fixed data_types_number_fixed.cpp) -target_link_libraries (data_types_number_fixed PRIVATE dbms) - -add_executable (data_type_string data_type_string.cpp) -target_link_libraries (data_type_string PRIVATE dbms) diff --git a/src/DataTypes/tests/data_type_string.cpp b/src/DataTypes/tests/data_type_string.cpp deleted file mode 100644 index bb394b1784c..00000000000 --- a/src/DataTypes/tests/data_type_string.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include - -#include -#include - -#include - -#include -#include -#include -#include - - -int main(int, char **) -try -{ - using namespace DB; - - Stopwatch stopwatch; - size_t n = 50000000; - const char * s = ""; - size_t size = strlen(s) + 1; - DataTypeString data_type; - - - { - auto column = ColumnString::create(); - ColumnString::Chars & data = column->getChars(); - ColumnString::Offsets & offsets = column->getOffsets(); - - data.resize(n * size); - offsets.resize(n); - for (size_t i = 0; i < n; ++i) - { - memcpy(&data[i * size], s, size); - offsets[i] = (i + 1) * size; - } - - WriteBufferFromFile out_buf("test"); - - IDataType::SerializeBinaryBulkSettings settings; - IDataType::SerializeBinaryBulkStatePtr state; - settings.getter = [&](const IDataType::SubstreamPath &){ return &out_buf; }; - - stopwatch.restart(); - data_type.serializeBinaryBulkStatePrefix(settings, state); - data_type.serializeBinaryBulkWithMultipleStreams(*column, 0, 0, settings, state); - data_type.serializeBinaryBulkStateSuffix(settings, state); - stopwatch.stop(); - - std::cout << "Writing, elapsed: " << stopwatch.elapsedSeconds() << std::endl; - } - - { - auto column = ColumnString::create(); - - ReadBufferFromFile in_buf("test"); - - IDataType::DeserializeBinaryBulkSettings settings; - IDataType::DeserializeBinaryBulkStatePtr state; - settings.getter = [&](const IDataType::SubstreamPath &){ return &in_buf; }; - - stopwatch.restart(); - data_type.deserializeBinaryBulkStatePrefix(settings, state); - data_type.deserializeBinaryBulkWithMultipleStreams(*column, n, settings, state); - stopwatch.stop(); - - std::cout << "Reading, elapsed: " << stopwatch.elapsedSeconds() << std::endl; - - std::cout << std::endl - << get((*column)[0]) << std::endl - << get((*column)[n - 1]) << std::endl; - } - - return 0; -} -catch (const DB::Exception & e) -{ - std::cerr << e.what() << ", " << e.displayText() << std::endl; - return 1; -} diff --git a/src/DataTypes/tests/data_types_number_fixed.cpp b/src/DataTypes/tests/data_types_number_fixed.cpp deleted file mode 100644 index 998d0f44481..00000000000 --- a/src/DataTypes/tests/data_types_number_fixed.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include - -#include - -#include -#include -#include - - -int main(int, char **) -{ - using namespace DB; - - auto column = ColumnUInt64::create(); - ColumnUInt64::Container & vec = column->getData(); - DataTypeUInt64 data_type; - - Stopwatch stopwatch; - size_t n = 10000000; - - vec.resize(n); - for (size_t i = 0; i < n; ++i) - vec[i] = i; - - std::ofstream ostr("test"); - WriteBufferFromOStream out_buf(ostr); - - stopwatch.restart(); - IDataType::SerializeBinaryBulkSettings settings; - settings.getter = [&](const IDataType::SubstreamPath &){ return &out_buf; }; - IDataType::SerializeBinaryBulkStatePtr state; - data_type.serializeBinaryBulkStatePrefix(settings, state); - data_type.serializeBinaryBulkWithMultipleStreams(*column, 0, 0, settings, state); - data_type.serializeBinaryBulkStateSuffix(settings, state); - stopwatch.stop(); - - std::cout << "Elapsed: " << stopwatch.elapsedSeconds() << std::endl; - - return 0; -}