| 1 | #include "duckdb/common/exception.hpp" |
|---|---|
| 2 | #include "duckdb/parser/expression/operator_expression.hpp" |
| 3 | #include "duckdb/parser/transformer.hpp" |
| 4 | |
| 5 | using namespace duckdb; |
| 6 | using namespace std; |
| 7 | |
| 8 | unique_ptr<ParsedExpression> Transformer::TransformNullTest(PGNullTest *root) { |
| 9 | assert(root); |
| 10 | auto arg = TransformExpression(reinterpret_cast<PGNode *>(root->arg)); |
| 11 | if (root->argisrow) { |
| 12 | throw NotImplementedException("IS NULL argisrow"); |
| 13 | } |
| 14 | ExpressionType expr_type = |
| 15 | (root->nulltesttype == PG_IS_NULL) ? ExpressionType::OPERATOR_IS_NULL : ExpressionType::OPERATOR_IS_NOT_NULL; |
| 16 | |
| 17 | return unique_ptr<ParsedExpression>(new OperatorExpression(expr_type, move(arg))); |
| 18 | } |
| 19 |