Removing refreshes [#METR-11408].

This commit is contained in:
Alexey Milovidov 2014-07-01 03:46:22 +04:00
parent 310df87971
commit cbab5fb193
6 changed files with 15 additions and 21 deletions

View File

@ -45,7 +45,6 @@ int main(int argc, char ** argv)
("UserAgent", new DB::DataTypeUInt8)
("URL", new DB::DataTypeString)
("Referer", new DB::DataTypeString)
("Refresh", new DB::DataTypeUInt8)
("ResolutionWidth", new DB::DataTypeUInt16)
("ResolutionHeight", new DB::DataTypeUInt16)
("ResolutionDepth", new DB::DataTypeUInt8)
@ -77,7 +76,7 @@ int main(int argc, char ** argv)
("SilverlightVersion3", new DB::DataTypeUInt32)
("SilverlightVersion4", new DB::DataTypeUInt16)
("PageCharset", new DB::DataTypeString)
("CodeVersion", new DB::DataTypeUInt32)
("CodeVersion", new DB::DataTypeUInt32)
("IsLink", new DB::DataTypeUInt8)
("IsDownload", new DB::DataTypeUInt8)
("IsNotBounce", new DB::DataTypeUInt8)
@ -107,12 +106,12 @@ int main(int argc, char ** argv)
elem.column = elem.type->createColumn();
sample.insert(elem);
}
/// читаем данные из строчного tsv файла и одновременно пишем в блочный tsv файл
{
DB::ReadBufferFromIStream in_buf(std::cin);
DB::WriteBufferFromOStream out_buf(std::cout);
DB::RowInputStreamPtr row_in = new DB::TabSeparatedRowInputStream(in_buf, sample);
DB::BlockInputStreamFromRowInputStream in(row_in, sample);
DB::TabSeparatedBlockOutputStream out(out_buf);

View File

@ -34,7 +34,7 @@ using Poco::SharedPtr;
int main(int argc, char ** argv)
{
using namespace DB;
try
{
NamesAndTypesListPtr names_and_types_list = new NamesAndTypesList;
@ -53,7 +53,6 @@ int main(int argc, char ** argv)
("UserAgent", new DataTypeUInt8)
("URL", new DataTypeString)
("Referer", new DataTypeString)
("Refresh", new DataTypeUInt8)
("ResolutionWidth", new DataTypeUInt16)
("ResolutionHeight", new DataTypeUInt16)
("ResolutionDepth", new DataTypeUInt8)
@ -150,7 +149,7 @@ int main(int argc, char ** argv)
in = new ExpressionBlockInputStream(in, expression);
in = new FilterBlockInputStream(in, 4);
//in = new LimitBlockInputStream(in, 10);
WriteBufferFromOStream ob(std::cout);
RowOutputStreamPtr out_ = new TabSeparatedRowOutputStream(ob, expression->getSampleBlock());
BlockOutputStreamFromRowOutputStream out(out_);

View File

@ -27,7 +27,7 @@
int main(int argc, char ** argv)
{
using Poco::SharedPtr;
try
{
DB::NamesAndTypesListPtr names_and_types_list = new DB::NamesAndTypesList;
@ -46,7 +46,6 @@ int main(int argc, char ** argv)
("UserAgent", new DB::DataTypeUInt8)
("URL", new DB::DataTypeString)
("Referer", new DB::DataTypeString)
("Refresh", new DB::DataTypeUInt8)
("ResolutionWidth", new DB::DataTypeUInt16)
("ResolutionHeight", new DB::DataTypeUInt16)
("ResolutionDepth", new DB::DataTypeUInt8)
@ -116,7 +115,7 @@ int main(int argc, char ** argv)
if (argc == 2 && 0 == strcmp(argv[1], "write"))
{
DB::DataTypeFactory factory;
DB::ReadBufferFromIStream in1(std::cin);
DB::CompressedReadBuffer in2(in1);
DB::NativeBlockInputStream in3(in2, factory);

View File

@ -34,7 +34,7 @@ using Poco::SharedPtr;
int main(int argc, char ** argv)
{
using namespace DB;
try
{
NamesAndTypesListPtr names_and_types_list = new NamesAndTypesList;
@ -53,7 +53,6 @@ int main(int argc, char ** argv)
("UserAgent", new DataTypeUInt8)
("URL", new DataTypeString)
("Referer", new DataTypeString)
("Refresh", new DataTypeUInt8)
("ResolutionWidth", new DataTypeUInt16)
("ResolutionHeight", new DataTypeUInt16)
("ResolutionDepth", new DataTypeUInt8)
@ -162,7 +161,7 @@ int main(int argc, char ** argv)
sort_columns.push_back(SortColumnDescription(3, 1));
QueryProcessingStage::Enum stage;
Poco::SharedPtr<IBlockInputStream> in = table->read(column_names, 0, Settings(), stage, argc == 2 ? atoi(argv[1]) : 1048576)[0];
in = new PartialSortingBlockInputStream(in, sort_columns);
in = new MergeSortingBlockInputStream(in, sort_columns);

View File

@ -10,7 +10,7 @@
int main(int argc, char ** argv)
{
using namespace DB;
try
{
ParserCreateQuery parser;
@ -29,7 +29,6 @@ int main(int argc, char ** argv)
"UserAgent UInt8,\n"
"URL String,\n"
"Referer String,\n"
"Refresh UInt8,\n"
"ResolutionWidth UInt16,\n"
"ResolutionHeight UInt16,\n"
"ResolutionDepth UInt8,\n"

View File

@ -46,7 +46,6 @@ int main(int argc, char ** argv)
("UserAgent", new DB::DataTypeUInt8)
("URL", new DB::DataTypeString)
("Referer", new DB::DataTypeString)
("Refresh", new DB::DataTypeUInt8)
("ResolutionWidth", new DB::DataTypeUInt16)
("ResolutionHeight", new DB::DataTypeUInt16)
("ResolutionDepth", new DB::DataTypeUInt8)
@ -78,7 +77,7 @@ int main(int argc, char ** argv)
("SilverlightVersion3", new DB::DataTypeUInt32)
("SilverlightVersion4", new DB::DataTypeUInt16)
("PageCharset", new DB::DataTypeString)
("CodeVersion", new DB::DataTypeUInt32)
("CodeVersion", new DB::DataTypeUInt32)
("IsLink", new DB::DataTypeUInt8)
("IsDownload", new DB::DataTypeUInt8)
("IsNotBounce", new DB::DataTypeUInt8)
@ -94,7 +93,7 @@ int main(int argc, char ** argv)
SharedPtr<DB::DataTypes> data_types = new DB::DataTypes;
DB::Names column_names;
for (DB::NamesAndTypesList::const_iterator it = names_and_types_list->begin(); it != names_and_types_list->end(); ++it)
{
data_types->push_back(it->second);
@ -102,7 +101,7 @@ int main(int argc, char ** argv)
}
/// создаём таблицу хит лога
DB::StoragePtr table = DB::StorageLog::create("./", "HitLog", names_and_types_list);
/// создаём описание, как читать данные из tab separated дампа
@ -116,12 +115,12 @@ int main(int argc, char ** argv)
elem.column = elem.type->createColumn();
sample.insert(elem);
}
/// читаем данные из tsv файла и одновременно пишем в таблицу
if (argc == 2 && 0 == strcmp(argv[1], "write"))
{
DB::ReadBufferFromIStream in_buf(std::cin);
DB::RowInputStreamPtr in_ = new DB::TabSeparatedRowInputStream(in_buf, sample);
DB::BlockInputStreamFromRowInputStream in(in_, sample);
DB::BlockOutputStreamPtr out = table->write(0);