Fixed build [#METR-2807].

This commit is contained in:
Alexey Milovidov 2015-02-01 11:24:49 +03:00
parent ebe7738c27
commit 7f0654cabb
5 changed files with 14 additions and 14 deletions

View File

@ -50,13 +50,13 @@ int main(int argc, char ** argv)
Context context;
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
ExpressionAnalyzer analyzer(ast, context);
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
ExpressionActionsChain chain;
analyzer.appendSelect(chain, false);
analyzer.appendProjectResult(chain, false);
chain.finalize();
ExpressionActionsPtr expression = chain.getLastActions();
StoragePtr table = StorageSystemNumbers::create("Numbers");
Names column_names;
@ -68,7 +68,7 @@ int main(int argc, char ** argv)
in = table->read(column_names, 0, context, Settings(), stage)[0];
in = new ExpressionBlockInputStream(in, expression);
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
WriteBufferFromOStream out1(std::cout);
RowOutputStreamPtr out2 = new TabSeparatedRowOutputStream(out1, expression->getSampleBlock());
BlockOutputStreamFromRowOutputStream out(out2);

View File

@ -28,7 +28,7 @@ using Poco::SharedPtr;
int main(int argc, char ** argv)
{
using namespace DB;
try
{
size_t n = argc == 2 ? parse<UInt64>(argv[1]) : 10ULL;
@ -56,13 +56,13 @@ int main(int argc, char ** argv)
Context context;
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
ExpressionAnalyzer analyzer(ast, context);
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
ExpressionActionsChain chain;
analyzer.appendSelect(chain, false);
analyzer.appendProjectResult(chain, false);
chain.finalize();
ExpressionActionsPtr expression = chain.getLastActions();
StoragePtr table = StorageSystemNumbers::create("Numbers");
Names column_names;
@ -74,7 +74,7 @@ int main(int argc, char ** argv)
in = new ExpressionBlockInputStream(in, expression);
in = new FilterBlockInputStream(in, 1);
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
WriteBufferFromOStream ob(std::cout);
RowOutputStreamPtr out_ = new TabSeparatedRowOutputStream(ob, expression->getSampleBlock());
BlockOutputStreamFromRowOutputStream out(out_);

View File

@ -125,7 +125,7 @@ int main(int argc, char ** argv)
/// читаем из неё, применяем выражение, фильтруем, и пишем в tsv виде в консоль
ExpressionAnalyzer analyzer(ast, context);
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
ExpressionActionsChain chain;
analyzer.appendSelect(chain, false);
analyzer.appendWhere(chain, false);

View File

@ -71,7 +71,7 @@ int main(int argc, char ** argv)
Context context;
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
ExpressionAnalyzer analyzer(ast, context);
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
ExpressionActionsChain chain;
analyzer.appendSelect(chain, false);
analyzer.appendProjectResult(chain, false);

View File

@ -26,7 +26,7 @@
int main(int argc, char ** argv)
{
using namespace DB;
try
{
ParserSelectQuery parser;
@ -64,8 +64,8 @@ int main(int argc, char ** argv)
columns.push_back(NameAndTypePair("s1", new DataTypeString));
columns.push_back(NameAndTypePair("s2", new DataTypeString));
context.setColumns(columns);
ExpressionAnalyzer analyzer(ast, context);
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
ExpressionActionsChain chain;
analyzer.appendSelect(chain, false);
analyzer.appendProjectResult(chain, false);
@ -75,7 +75,7 @@ int main(int argc, char ** argv)
size_t n = argc == 2 ? atoi(argv[1]) : 10;
Block block;
ColumnWithNameAndType column_x;
column_x.name = "x";
column_x.type = new DataTypeInt16;
@ -123,7 +123,7 @@ int main(int argc, char ** argv)
<< ", " << n * 1000000 / stopwatch.elapsed() << " rows/sec."
<< std::endl;
}
OneBlockInputStream * is = new OneBlockInputStream(block);
LimitBlockInputStream lis(is, 20, std::max(0, static_cast<int>(n) - 20));
WriteBufferFromOStream out_buf(std::cout);