Removed obsolete test binary [#CLICKHOUSE-3].

This commit is contained in:
Alexey Milovidov 2017-07-10 06:43:25 +03:00
parent 89939a685a
commit db3d56b1f5
2 changed files with 0 additions and 74 deletions

View File

@ -43,6 +43,3 @@ target_link_libraries (fork_streams dbms clickhouse_storages_system)
add_executable (glue_streams glue_streams.cpp ${SRCS})
target_link_libraries (glue_streams dbms)
add_executable (json_streams json_streams.cpp ${SRCS})
target_link_libraries (json_streams dbms)

View File

@ -1,71 +0,0 @@
#include <map>
#include <list>
#include <iostream>
#include <fstream>
#include <IO/ReadBufferFromIStream.h>
#include <IO/WriteBufferFromOStream.h>
#include <DataTypes/DataTypesNumber.h>
#include <DataTypes/DataTypeString.h>
#include <DataTypes/DataTypeFixedString.h>
#include <DataTypes/DataTypeDateTime.h>
#include <DataStreams/TabSeparatedRowInputStream.h>
#include <DataStreams/TabSeparatedBlockOutputStream.h>
#include <DataStreams/JSONRowOutputStream.h>
#include <DataStreams/JSONCompactRowOutputStream.h>
#include <DataStreams/BlockInputStreamFromRowInputStream.h>
#include <DataStreams/BlockOutputStreamFromRowOutputStream.h>
#include <DataStreams/copyData.h>
#include <Storages/StorageLog.h>
using namespace DB;
int main(int argc, char ** argv)
try
{
NamesAndTypesList names_and_types_list
{
{"WatchID", std::make_shared<DataTypeUInt64>()},
{"ClientIP", std::make_shared<DataTypeUInt32>()},
{"Referer", std::make_shared<DataTypeString>()},
{"URL", std::make_shared<DataTypeString>()},
{"IsLink", std::make_shared<DataTypeUInt8>()},
{"OriginalUserAgent", std::make_shared<DataTypeString>()},
{"EventTime", std::make_shared<DataTypeDateTime>()},
};
Block sample;
for (const auto & name_type : names_and_types_list)
{
ColumnWithTypeAndName elem;
elem.name = name_type.name;
elem.type = name_type.type;
elem.column = elem.type->createColumn();
sample.insert(std::move(elem));
}
{
std::ifstream istr("json_test.in");
std::ofstream ostr("json_test.out");
ReadBufferFromIStream in_buf(istr);
WriteBufferFromOStream out_buf(ostr);
BlockInputStreamFromRowInputStream in(std::make_shared<TabSeparatedRowInputStream>(in_buf, sample, true, true),
sample, DEFAULT_INSERT_BLOCK_SIZE, 0, 0);
BlockOutputStreamFromRowOutputStream out(std::make_shared<JSONRowOutputStream>(out_buf, sample, false, true));
copyData(in, out);
}
return 0;
}
catch (const Exception & e)
{
std::cerr << e.what() << ", " << e.displayText() << std::endl;
throw;
}