OmniSciDB  dfae7c3b14
Parser::CardinalityExpr Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::CardinalityExpr:
+ Collaboration diagram for Parser::CardinalityExpr:

Public Member Functions

 CardinalityExpr (Expr *a)
 
const Exprget_arg () const
 
std::shared_ptr< Analyzer::Expranalyze (const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
 
std::string to_string () const override
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Private Attributes

std::unique_ptr< Exprarg
 

Additional Inherited Members

- Public Types inherited from Parser::Expr
enum  TlistRefType { TLIST_NONE, TLIST_REF, TLIST_COPY }
 

Detailed Description

Definition at line 468 of file ParserNode.h.

Constructor & Destructor Documentation

◆ CardinalityExpr()

Parser::CardinalityExpr::CardinalityExpr ( Expr a)
inline

Definition at line 470 of file ParserNode.h.

470 : arg(a) {}
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479

Member Function Documentation

◆ analyze()

std::shared_ptr< Analyzer::Expr > Parser::CardinalityExpr::analyze ( const Catalog_Namespace::Catalog catalog,
Analyzer::Query query,
TlistRefType  allow_tlist_ref = TLIST_NONE 
) const
overridevirtual

Implements Parser::Expr.

Definition at line 473 of file ParserNode.cpp.

References run_benchmark_import::result.

476  {
477  auto arg_expr = arg->analyze(catalog, query, allow_tlist_ref);
478  if (!arg_expr->get_type_info().is_array()) {
479  throw std::runtime_error(
480  "expression in cardinality clause must be of an array type.");
481  }
482  std::shared_ptr<Analyzer::Expr> result =
483  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
484  return result;
485 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479

◆ get_arg()

const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 471 of file ParserNode.h.

References to_string().

471 { return arg.get(); }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479
+ Here is the call graph for this function:

◆ to_string()

std::string Parser::CardinalityExpr::to_string ( ) const
overridevirtual

Implements Parser::Expr.

Definition at line 1379 of file ParserNode.cpp.

1379  {
1380  std::string str = "CARDINALITY(" + arg->to_string() + ")";
1381  return str;
1382 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479

Member Data Documentation

◆ arg

std::unique_ptr<Expr> Parser::CardinalityExpr::arg
private

Definition at line 479 of file ParserNode.h.


The documentation for this class was generated from the following files: