2017-01-05 07:25:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/Parsers/IAST.h>
|
2017-01-05 09:26:49 +00:00
|
|
|
#include <DB/Core/Block.h>
|
2017-01-05 07:25:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class WriteBuffer;
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
|
2017-01-05 09:26:49 +00:00
|
|
|
/** For SELECT query, determine names and types of columns of result,
|
|
|
|
* and if some columns are constant expressions, calculate their values.
|
2017-01-05 07:25:23 +00:00
|
|
|
*
|
|
|
|
* NOTE It's possible to memoize calculations, that happens under the hood
|
|
|
|
* and could be duplicated in subsequent analysis of subqueries.
|
|
|
|
*/
|
|
|
|
struct AnalyzeResultOfQuery
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
void process(ASTPtr & ast, Context & context);
|
2017-01-05 07:25:23 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
/// Block will have non-nullptr columns for constant expressions.
|
|
|
|
Block result;
|
2017-01-05 07:25:23 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
/// Debug output
|
|
|
|
void dump(WriteBuffer & out) const;
|
2017-01-05 07:25:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|