OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 473 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 475 of file ParserNode.h.

475 : arg_(a) {}
constexpr double a
Definition: Utm.h:32
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:484

Member Function Documentation

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 619 of file ParserNode.cpp.

References run_benchmark_import::result.

622  {
623  auto arg_expr = arg_->analyze(catalog, query, allow_tlist_ref);
624  if (!arg_expr->get_type_info().is_array()) {
625  throw std::runtime_error(
626  "expression in cardinality clause must be of an array type.");
627  }
628  std::shared_ptr<Analyzer::Expr> result =
629  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
630  return result;
631 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:484
const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 476 of file ParserNode.h.

References arg_.

476 { return arg_.get(); }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:484
std::string Parser::CardinalityExpr::to_string ( ) const
overridevirtual

Implements Parser::Expr.

Definition at line 2208 of file ParserNode.cpp.

2208  {
2209  std::string str = "CARDINALITY(" + arg_->to_string() + ")";
2210  return str;
2211 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:484

Member Data Documentation

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

Definition at line 484 of file ParserNode.h.

Referenced by get_arg().


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