2016-05-03 23:19:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-09 14:32:11 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
2016-05-03 23:19:14 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** CASE construction
|
|
|
|
* Two variants:
|
|
|
|
* 1. CASE expr WHEN val1 THEN res1 [WHEN ...] ELSE resN END
|
|
|
|
* 2. CASE WHEN cond1 THEN res1 [WHEN ...] ELSE resN END
|
|
|
|
* NOTE Until we get full support for NULL values in ClickHouse, ELSE sections are mandatory.
|
|
|
|
*/
|
|
|
|
class ParserCase final : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
const char * getName() const override { return "case"; }
|
2017-07-10 03:28:12 +00:00
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2016-05-03 23:19:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|