mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Fixed build [#METR-2807].
This commit is contained in:
parent
ebe7738c27
commit
7f0654cabb
@ -50,13 +50,13 @@ int main(int argc, char ** argv)
|
|||||||
Context context;
|
Context context;
|
||||||
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
||||||
|
|
||||||
ExpressionAnalyzer analyzer(ast, context);
|
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
|
||||||
ExpressionActionsChain chain;
|
ExpressionActionsChain chain;
|
||||||
analyzer.appendSelect(chain, false);
|
analyzer.appendSelect(chain, false);
|
||||||
analyzer.appendProjectResult(chain, false);
|
analyzer.appendProjectResult(chain, false);
|
||||||
chain.finalize();
|
chain.finalize();
|
||||||
ExpressionActionsPtr expression = chain.getLastActions();
|
ExpressionActionsPtr expression = chain.getLastActions();
|
||||||
|
|
||||||
StoragePtr table = StorageSystemNumbers::create("Numbers");
|
StoragePtr table = StorageSystemNumbers::create("Numbers");
|
||||||
|
|
||||||
Names column_names;
|
Names column_names;
|
||||||
@ -68,7 +68,7 @@ int main(int argc, char ** argv)
|
|||||||
in = table->read(column_names, 0, context, Settings(), stage)[0];
|
in = table->read(column_names, 0, context, Settings(), stage)[0];
|
||||||
in = new ExpressionBlockInputStream(in, expression);
|
in = new ExpressionBlockInputStream(in, expression);
|
||||||
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
|
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
|
||||||
|
|
||||||
WriteBufferFromOStream out1(std::cout);
|
WriteBufferFromOStream out1(std::cout);
|
||||||
RowOutputStreamPtr out2 = new TabSeparatedRowOutputStream(out1, expression->getSampleBlock());
|
RowOutputStreamPtr out2 = new TabSeparatedRowOutputStream(out1, expression->getSampleBlock());
|
||||||
BlockOutputStreamFromRowOutputStream out(out2);
|
BlockOutputStreamFromRowOutputStream out(out2);
|
||||||
|
@ -28,7 +28,7 @@ using Poco::SharedPtr;
|
|||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
using namespace DB;
|
using namespace DB;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
size_t n = argc == 2 ? parse<UInt64>(argv[1]) : 10ULL;
|
size_t n = argc == 2 ? parse<UInt64>(argv[1]) : 10ULL;
|
||||||
@ -56,13 +56,13 @@ int main(int argc, char ** argv)
|
|||||||
Context context;
|
Context context;
|
||||||
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
||||||
|
|
||||||
ExpressionAnalyzer analyzer(ast, context);
|
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
|
||||||
ExpressionActionsChain chain;
|
ExpressionActionsChain chain;
|
||||||
analyzer.appendSelect(chain, false);
|
analyzer.appendSelect(chain, false);
|
||||||
analyzer.appendProjectResult(chain, false);
|
analyzer.appendProjectResult(chain, false);
|
||||||
chain.finalize();
|
chain.finalize();
|
||||||
ExpressionActionsPtr expression = chain.getLastActions();
|
ExpressionActionsPtr expression = chain.getLastActions();
|
||||||
|
|
||||||
StoragePtr table = StorageSystemNumbers::create("Numbers");
|
StoragePtr table = StorageSystemNumbers::create("Numbers");
|
||||||
|
|
||||||
Names column_names;
|
Names column_names;
|
||||||
@ -74,7 +74,7 @@ int main(int argc, char ** argv)
|
|||||||
in = new ExpressionBlockInputStream(in, expression);
|
in = new ExpressionBlockInputStream(in, expression);
|
||||||
in = new FilterBlockInputStream(in, 1);
|
in = new FilterBlockInputStream(in, 1);
|
||||||
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
|
in = new LimitBlockInputStream(in, 10, std::max(static_cast<Int64>(0), static_cast<Int64>(n) - 10));
|
||||||
|
|
||||||
WriteBufferFromOStream ob(std::cout);
|
WriteBufferFromOStream ob(std::cout);
|
||||||
RowOutputStreamPtr out_ = new TabSeparatedRowOutputStream(ob, expression->getSampleBlock());
|
RowOutputStreamPtr out_ = new TabSeparatedRowOutputStream(ob, expression->getSampleBlock());
|
||||||
BlockOutputStreamFromRowOutputStream out(out_);
|
BlockOutputStreamFromRowOutputStream out(out_);
|
||||||
|
@ -125,7 +125,7 @@ int main(int argc, char ** argv)
|
|||||||
|
|
||||||
/// читаем из неё, применяем выражение, фильтруем, и пишем в tsv виде в консоль
|
/// читаем из неё, применяем выражение, фильтруем, и пишем в tsv виде в консоль
|
||||||
|
|
||||||
ExpressionAnalyzer analyzer(ast, context);
|
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
|
||||||
ExpressionActionsChain chain;
|
ExpressionActionsChain chain;
|
||||||
analyzer.appendSelect(chain, false);
|
analyzer.appendSelect(chain, false);
|
||||||
analyzer.appendWhere(chain, false);
|
analyzer.appendWhere(chain, false);
|
||||||
|
@ -71,7 +71,7 @@ int main(int argc, char ** argv)
|
|||||||
Context context;
|
Context context;
|
||||||
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
context.getColumns().push_back(NameAndTypePair("number", new DataTypeUInt64));
|
||||||
|
|
||||||
ExpressionAnalyzer analyzer(ast, context);
|
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
|
||||||
ExpressionActionsChain chain;
|
ExpressionActionsChain chain;
|
||||||
analyzer.appendSelect(chain, false);
|
analyzer.appendSelect(chain, false);
|
||||||
analyzer.appendProjectResult(chain, false);
|
analyzer.appendProjectResult(chain, false);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
using namespace DB;
|
using namespace DB;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ParserSelectQuery parser;
|
ParserSelectQuery parser;
|
||||||
@ -64,8 +64,8 @@ int main(int argc, char ** argv)
|
|||||||
columns.push_back(NameAndTypePair("s1", new DataTypeString));
|
columns.push_back(NameAndTypePair("s1", new DataTypeString));
|
||||||
columns.push_back(NameAndTypePair("s2", new DataTypeString));
|
columns.push_back(NameAndTypePair("s2", new DataTypeString));
|
||||||
context.setColumns(columns);
|
context.setColumns(columns);
|
||||||
|
|
||||||
ExpressionAnalyzer analyzer(ast, context);
|
ExpressionAnalyzer analyzer(ast, context, context.getColumns());
|
||||||
ExpressionActionsChain chain;
|
ExpressionActionsChain chain;
|
||||||
analyzer.appendSelect(chain, false);
|
analyzer.appendSelect(chain, false);
|
||||||
analyzer.appendProjectResult(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;
|
size_t n = argc == 2 ? atoi(argv[1]) : 10;
|
||||||
|
|
||||||
Block block;
|
Block block;
|
||||||
|
|
||||||
ColumnWithNameAndType column_x;
|
ColumnWithNameAndType column_x;
|
||||||
column_x.name = "x";
|
column_x.name = "x";
|
||||||
column_x.type = new DataTypeInt16;
|
column_x.type = new DataTypeInt16;
|
||||||
@ -123,7 +123,7 @@ int main(int argc, char ** argv)
|
|||||||
<< ", " << n * 1000000 / stopwatch.elapsed() << " rows/sec."
|
<< ", " << n * 1000000 / stopwatch.elapsed() << " rows/sec."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
OneBlockInputStream * is = new OneBlockInputStream(block);
|
OneBlockInputStream * is = new OneBlockInputStream(block);
|
||||||
LimitBlockInputStream lis(is, 20, std::max(0, static_cast<int>(n) - 20));
|
LimitBlockInputStream lis(is, 20, std::max(0, static_cast<int>(n) - 20));
|
||||||
WriteBufferFromOStream out_buf(std::cout);
|
WriteBufferFromOStream out_buf(std::cout);
|
||||||
|
Loading…
Reference in New Issue
Block a user