OmniSciDB  04ee39c94c
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

◆ CardinalityExpr()

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

Definition at line 475 of file ParserNode.h.

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

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

References run-benchmark-import::result.

457  {
458  auto arg_expr = arg->analyze(catalog, query, allow_tlist_ref);
459  if (!arg_expr->get_type_info().is_array()) {
460  throw std::runtime_error(
461  "expression in cardinality clause must be of an array type.");
462  }
463  std::shared_ptr<Analyzer::Expr> result =
464  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
465  return result;
466 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:484

◆ get_arg()

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

Definition at line 476 of file ParserNode.h.

References anonymous_namespace{UpdateMetadataTest.cpp}::query, and to_string().

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

◆ to_string()

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

Implements Parser::Expr.

Definition at line 1422 of file ParserNode.cpp.

1422  {
1423  std::string str = "CARDINALITY(" + arg->to_string() + ")";
1424  return str;
1425 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:484

Member Data Documentation

◆ arg

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

Definition at line 484 of file ParserNode.h.


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