OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor:
+ Collaboration diagram for anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor:

Protected Types

using RetType = DeepCopyVisitor::RetType
 
- Protected Types inherited from DeepCopyVisitor
using RetType = std::shared_ptr< Analyzer::Expr >
 

Protected Member Functions

RetType visitArrayOper (const Analyzer::ArrayExpr *array_expr) const override
 
- Protected Member Functions inherited from DeepCopyVisitor
RetType visitColumnVar (const Analyzer::ColumnVar *col_var) const override
 
RetType visitColumnVarTuple (const Analyzer::ExpressionTuple *col_var_tuple) const override
 
RetType visitVar (const Analyzer::Var *var) const override
 
RetType visitConstant (const Analyzer::Constant *constant) const override
 
RetType visitUOper (const Analyzer::UOper *uoper) const override
 
RetType visitBinOper (const Analyzer::BinOper *bin_oper) const override
 
RetType visitGeoExpr (const Analyzer::GeoExpr *geo_expr) const override
 
RetType visitInValues (const Analyzer::InValues *in_values) const override
 
RetType visitInIntegerSet (const Analyzer::InIntegerSet *in_integer_set) const override
 
RetType visitCharLength (const Analyzer::CharLengthExpr *char_length) const override
 
RetType visitKeyForString (const Analyzer::KeyForStringExpr *expr) const override
 
RetType visitSampleRatio (const Analyzer::SampleRatioExpr *expr) const override
 
RetType visitMLPredict (const Analyzer::MLPredictExpr *expr) const override
 
RetType visitPCAProject (const Analyzer::PCAProjectExpr *expr) const override
 
RetType visitCardinality (const Analyzer::CardinalityExpr *cardinality) const override
 
RetType visitLikeExpr (const Analyzer::LikeExpr *like) const override
 
RetType visitRegexpExpr (const Analyzer::RegexpExpr *regexp) const override
 
RetType visitWidthBucket (const Analyzer::WidthBucketExpr *width_bucket_expr) const override
 
RetType visitCaseExpr (const Analyzer::CaseExpr *case_expr) const override
 
RetType visitDatetruncExpr (const Analyzer::DatetruncExpr *datetrunc) const override
 
RetType visitExtractExpr (const Analyzer::ExtractExpr *extract) const override
 
RetType visitGeoUOper (const Analyzer::GeoUOper *geo_expr) const override
 
RetType visitGeoBinOper (const Analyzer::GeoBinOper *geo_expr) const override
 
RetType visitWindowFunction (const Analyzer::WindowFunction *window_func) const override
 
RetType visitStringOper (const Analyzer::StringOper *string_oper) const override
 
RetType visitFunctionOper (const Analyzer::FunctionOper *func_oper) const override
 
RetType visitDatediffExpr (const Analyzer::DatediffExpr *datediff) const override
 
RetType visitDateaddExpr (const Analyzer::DateaddExpr *dateadd) const override
 
RetType visitFunctionOperWithCustomTypeHandling (const Analyzer::FunctionOperWithCustomTypeHandling *func_oper) const override
 
RetType visitLikelihood (const Analyzer::LikelihoodExpr *likelihood) const override
 
RetType visitAggExpr (const Analyzer::AggExpr *agg) const override
 
RetType visitOffsetInFragment (const Analyzer::OffsetInFragment *) const override
 
- Protected Member Functions inherited from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >
virtual std::shared_ptr
< Analyzer::Expr
visitRangeJoinOper (const Analyzer::RangeOper *range_oper) const
 
virtual std::shared_ptr
< Analyzer::Expr
aggregateResult (const std::shared_ptr< Analyzer::Expr > &aggregate, const std::shared_ptr< Analyzer::Expr > &next_result) const
 
virtual void visitBegin () const
 
virtual std::shared_ptr
< Analyzer::Expr
defaultResult () const
 

Additional Inherited Members

- Public Member Functions inherited from ScalarExprVisitor< std::shared_ptr< Analyzer::Expr > >
std::shared_ptr< Analyzer::Exprvisit (const Analyzer::Expr *expr) const
 

Detailed Description

Definition at line 193 of file ExpressionRewrite.cpp.

Member Typedef Documentation

using anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor::RetType = DeepCopyVisitor::RetType
protected

Definition at line 195 of file ExpressionRewrite.cpp.

Member Function Documentation

RetType anonymous_namespace{ExpressionRewrite.cpp}::ArrayElementStringLiteralEncodingVisitor::visitArrayOper ( const Analyzer::ArrayExpr array_expr) const
inlineoverrideprotectedvirtual

Reimplemented from DeepCopyVisitor.

Definition at line 197 of file ExpressionRewrite.cpp.

References Analyzer::Expr::get_type_info(), Analyzer::ArrayExpr::getElement(), Analyzer::ArrayExpr::getElementCount(), Analyzer::ArrayExpr::isLocalAlloc(), Analyzer::ArrayExpr::isNull(), kENCODING_DICT, kENCODING_NONE, shared::StringDictKey::kTransientDictKey, and TRANSIENT_DICT_ID.

197  {
198  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
199  for (size_t i = 0; i < array_expr->getElementCount(); ++i) {
200  auto const element_expr_ptr = visit(array_expr->getElement(i));
201  auto const& element_expr_type_info = element_expr_ptr->get_type_info();
202 
203  if (!element_expr_type_info.is_string() ||
204  element_expr_type_info.get_compression() != kENCODING_NONE) {
205  args_copy.push_back(element_expr_ptr);
206  } else {
207  auto transient_dict_type_info = element_expr_type_info;
208 
209  transient_dict_type_info.set_compression(kENCODING_DICT);
210  transient_dict_type_info.set_comp_param(TRANSIENT_DICT_ID);
211  transient_dict_type_info.setStringDictKey(
213  transient_dict_type_info.set_fixed_size();
214  args_copy.push_back(element_expr_ptr->add_cast(transient_dict_type_info));
215  }
216  }
217 
218  const auto& type_info = array_expr->get_type_info();
219  return makeExpr<Analyzer::ArrayExpr>(
220  type_info, args_copy, array_expr->isNull(), array_expr->isLocalAlloc());
221  }
std::shared_ptr< Analyzer::Expr > visit(const Analyzer::Expr *expr) const
bool isNull() const
Definition: Analyzer.h:3025
#define TRANSIENT_DICT_ID
Definition: DbObjectKeys.h:24
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79
size_t getElementCount() const
Definition: Analyzer.h:3023
bool isLocalAlloc() const
Definition: Analyzer.h:3024
static const StringDictKey kTransientDictKey
Definition: DbObjectKeys.h:45
const Analyzer::Expr * getElement(const size_t i) const
Definition: Analyzer.h:3027

+ Here is the call graph for this function:


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