OmniSciDB  a5dc49c757
 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 474 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 476 of file ParserNode.h.

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

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

References run_benchmark_import::result.

632  {
633  auto arg_expr = arg_->analyze(catalog, query, allow_tlist_ref);
634  if (!arg_expr->get_type_info().is_array()) {
635  throw std::runtime_error(
636  "expression in cardinality clause must be of an array type.");
637  }
638  std::shared_ptr<Analyzer::Expr> result =
639  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
640  return result;
641 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:485
const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 477 of file ParserNode.h.

References arg_.

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

Implements Parser::Expr.

Definition at line 2249 of file ParserNode.cpp.

2249  {
2250  std::string str = "CARDINALITY(" + arg_->to_string() + ")";
2251  return str;
2252 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:485

Member Data Documentation

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

Definition at line 485 of file ParserNode.h.

Referenced by get_arg().


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