OmniSciDB
a5dc49c757
|
#include <RelAlgTranslator.h>
Public Member Functions | |
RelAlgTranslator (std::shared_ptr< const query_state::QueryState > q_s, const Executor *executor, const std::unordered_map< const RelAlgNode *, int > &input_to_nest_level, const std::vector< JoinType > &join_types, const time_t now, const bool just_explain) | |
std::shared_ptr< Analyzer::Expr > | translate (const RexScalar *rex) const |
bool | generated_geos_ops () |
template<typename T > | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
template<> | |
std::shared_ptr< Analyzer::Expr > | translateRexScalar (RexScalar const *rex) const |
Static Public Member Functions | |
static std::shared_ptr < Analyzer::Expr > | translateAggregateRex (const RexAgg *rex, const std::vector< std::shared_ptr< Analyzer::Expr >> &scalar_sources) |
static std::shared_ptr < Analyzer::Expr > | translateLiteral (const RexLiteral *) |
Private Attributes | |
std::shared_ptr< const query_state::QueryState > | query_state_ |
const Executor * | executor_ |
const std::unordered_map < const RelAlgNode *, int > | input_to_nest_level_ |
const std::vector< JoinType > | join_types_ |
time_t | now_ |
bool | generated_geos_ops_ |
const bool | just_explain_ |
robin_hood::unordered_map < RexScalar const *, std::shared_ptr < Analyzer::Expr > > | cache_ |
Definition at line 49 of file RelAlgTranslator.h.
|
inline |
Definition at line 51 of file RelAlgTranslator.h.
|
inline |
|
private |
Definition at line 976 of file RelAlgTranslator.cpp.
References threading_serial::async(), result_set::can_use_parallel_algorithms(), CHECK, CHECK_EQ, CHECK_GE, cpu_threads(), executor_, anonymous_namespace{RelAlgTranslator.cpp}::fill_dictionary_encoded_in_vals(), anonymous_namespace{RelAlgTranslator.cpp}::fill_integer_in_vals(), g_cluster, Catalog_Namespace::SysCatalog::getCatalog(), inline_int_null_val(), Catalog_Namespace::SysCatalog::instance(), and kENCODING_DICT.
Referenced by translateInOper().
|
private |
Definition at line 61 of file RelAlgTranslator.cpp.
References CHECK_EQ, RexFunctionOperator::getName(), kALL, kANY, kCAST, kONE, and translateScalarRex().
Referenced by translateOper().
std::shared_ptr< Analyzer::Expr > RelAlgTranslator::translate | ( | const RexScalar * | rex | ) | const |
Definition at line 262 of file RelAlgTranslator.cpp.
References cache_, and translateScalarRex().
Referenced by anonymous_namespace{RelAlgExecutor.cpp}::get_inputs_meta(), RelAlgExecutor::makeJoinQuals(), anonymous_namespace{RelAlgExecutor.cpp}::translate_quals(), anonymous_namespace{RelAlgExecutor.cpp}::translate_scalar_sources(), anonymous_namespace{RelAlgExecutor.cpp}::translate_scalar_sources_for_update(), and anonymous_namespace{RelAlgExecutor.cpp}::translate_targets().
|
private |
Definition at line 1674 of file RelAlgTranslator.cpp.
References CHECK, CHECK_EQ, RexOperator::getOperand(), kBOOLEAN, kLT, kONE, kUMINUS, anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
static |
Definition at line 281 of file RelAlgTranslator.cpp.
References CHECK_LE, CHECK_LT, Datum::doubleval, g_cluster, get_agg_type(), RexAgg::getKind(), RexAgg::getOperand(), anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type(), anonymous_namespace{RelAlgOptimizer.cpp}::is_distinct(), anonymous_namespace{RelAlgTranslator.cpp}::is_distinct_supported(), RexAgg::isDistinct(), kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, kBOOLEAN, kCOUNT_IF, kDOUBLE, kINT, kMODE, kSUM_IF, RexAgg::size(), ThriftSerializers::takes_arg(), and toString().
Referenced by anonymous_namespace{RelAlgExecutor.cpp}::translate_targets().
|
private |
Definition at line 1716 of file RelAlgTranslator.cpp.
References CHECK, get_nullable_logical_type_info(), SQLTypeInfo::get_subtype(), RexOperator::getType(), kARRAY, kBOOLEAN, kENCODING_DICT, kNULLT, kTEXT, shared::StringDictKey::kTransientDictKey, to_string(), TRANSIENT_DICT_ID, and translateFunctionArgs().
Referenced by translateFunction().
|
private |
Definition at line 934 of file RelAlgTranslatorGeo.cpp.
References func_resolve, SQLTypeInfo::get_input_srid(), SQLTypeInfo::get_output_srid(), RexFunctionOperator::getName(), RexOperator::getOperand(), Geospatial::GeoBase::kBUFFER, Geospatial::GeoBase::kCONCAVEHULL, Geospatial::GeoBase::kDIFFERENCE, kDOUBLE, kENCODING_NONE, kGEOMETRY, Geospatial::GeoBase::kINTERSECTION, kMULTIPOLYGON, Geospatial::GeoBase::kUNION, SQLTypeInfo::set_comp_param(), SQLTypeInfo::set_compression(), SQLTypeInfo::set_input_srid(), SQLTypeInfo::set_output_srid(), SQLTypeInfo::set_subtype(), SQLTypeInfo::set_type(), translateGeoFunctionArg(), and translateScalarRex().
Referenced by translateFunction(), and translateGeoFunctionArg().
|
private |
Definition at line 1333 of file RelAlgTranslatorGeo.cpp.
References run_benchmark_import::args, CHECK, CHECK_EQ, CHECK_GT, Datum::doubleval, fold_expr(), func_resolve, g_enable_geo_ops_on_uncompressed_coords, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), Geospatial::get_compression_scheme(), SQLTypeInfo::get_input_srid(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::getType(), Datum::intval, kBOOLEAN, kDOUBLE, kENCODING_GEOINT, kENCODING_NONE, kGEOGRAPHY, kINT, kLE, kLINESTRING, kMULTILINESTRING, kMULTIPOLYGON, kNOT, kNULLT, kONE, kPOINT, kPOLYGON, run_benchmark_import::result, RexOperator::size(), spatial_type::suffix(), TOLERANCE_GEOINT32, translateGeoColumn(), translateGeoFunctionArg(), and translateScalarRex().
Referenced by translateFunction(), and translateTernaryGeoFunction().
|
private |
Definition at line 1045 of file RelAlgTranslatorGeo.cpp.
References RexFunctionOperator::getName(), RexOperator::getOperand(), kBOOLEAN, Geospatial::GeoBase::kEQUALS, and translateGeoFunctionArg().
Referenced by translateFunction(), and translateGeoFunctionArg().
|
private |
Definition at line 1121 of file RelAlgTranslator.cpp.
References CHECK, RexOperator::getOperand(), RexOperator::getOperator(), kBBOX_INTERSECT, translateGeoBoundingBoxIntersectOper(), and translateScalarRex().
Referenced by translateOper().
|
private |
Definition at line 1604 of file RelAlgTranslator.cpp.
References RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::getType(), kARRAY, anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1137 of file RelAlgTranslator.cpp.
References RexCase::branchCount(), executor_, RexCase::getElse(), RexCase::getThen(), RexCase::getWhen(), Parser::CaseExpr::normalize(), and translateScalarRex().
|
private |
Definition at line 1640 of file RelAlgTranslator.cpp.
References Datum::bigintval, is_null(), kDATE, and now_.
Referenced by translateFunction().
|
private |
Definition at line 1647 of file RelAlgTranslator.cpp.
References Datum::bigintval, is_null(), kTIME, and now_.
Referenced by translateFunction().
|
private |
Definition at line 1654 of file RelAlgTranslator.cpp.
References Parser::TimestampLiteral::get(), and now_.
Referenced by translateDatetime(), and translateFunction().
|
private |
Definition at line 1517 of file RelAlgTranslator.cpp.
References Parser::UserLiteral::get(), and query_state_.
Referenced by translateFunction().
|
private |
Definition at line 1340 of file RelAlgTranslator.cpp.
References CHECK_EQ, field(), RexOperator::getOperand(), kBIGINT, kTIME, kTIMESTAMP, RexOperator::size(), to_dateadd_field(), translateScalarRex(), and anonymous_namespace{RelAlgTranslator.cpp}::validate_datetime_datepart_argument().
Referenced by translateFunction().
|
private |
Definition at line 1455 of file RelAlgTranslator.cpp.
References CHECK_EQ, field(), RexOperator::getOperand(), kBIGINT, RexOperator::size(), to_datediff_field(), translateScalarRex(), and anonymous_namespace{RelAlgTranslator.cpp}::validate_datetime_datepart_argument().
Referenced by translateFunction().
|
private |
Definition at line 1467 of file RelAlgTranslator.cpp.
References CHECK_EQ, ExtractExpr::generate(), RexOperator::getOperand(), RexOperator::size(), to_datepart_field(), translateScalarRex(), and anonymous_namespace{RelAlgTranslator.cpp}::validate_datetime_datepart_argument().
Referenced by translateFunction().
|
private |
Definition at line 1373 of file RelAlgTranslator.cpp.
References run_benchmark_import::args, CHECK, daMONTH, daSECOND, dtMONTH, dtSECOND, fold_expr(), anonymous_namespace{RelAlgTranslator.cpp}::get_datetimeplus_rewrite_funcname(), RexOperator::getOperand(), RexOperator::getOperator(), RexOperator::getType(), kBIGINT, kDATE, kDIVIDE, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kMINUS, kMULTIPLY, kONE, kPLUS, kTIME, kTIMESTAMP, kUMINUS, anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), run_benchmark_import::result, rewrite_to_date_trunc(), RexOperator::size(), and translateScalarRex().
Referenced by translateOper().
|
private |
Definition at line 1658 of file RelAlgTranslator.cpp.
References CHECK, CHECK_EQ, RexOperator::getOperand(), RexOperator::size(), translateCurrentTimestamp(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1281 of file RelAlgTranslator.cpp.
References CHECK_EQ, ExtractExpr::generate(), DateTruncExpr::generate(), RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::size(), translateScalarRex(), and anonymous_namespace{RelAlgTranslator.cpp}::validate_datetime_datepart_argument().
Referenced by translateFunction().
|
private |
Definition at line 2231 of file RelAlgTranslator.cpp.
References CHECK, anonymous_namespace{RelAlgTranslator.cpp}::is_negative_framing_bound(), and translateScalarRex().
Referenced by translateWindowFunction().
|
private |
Definition at line 1788 of file RelAlgTranslator.cpp.
References run_benchmark_import::args, bind_function(), CHECK, CHECK_EQ, CHECK_LE, CHECK_LT, ext_arg_type_to_type_info(), func_resolve, RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::getType(), Int64, SQLTypeInfo::is_decimal(), kDIVIDE, kONE, kSMALLINT, kTEXT, LOG, Parser::OperExpr::normalize(), PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, rewrite_to_date_trunc(), SQLTypeInfo::set_notnull(), RexOperator::size(), Datum::smallintval, translateAbs(), translateArrayFunction(), translateBinaryGeoConstructor(), translateBinaryGeoFunction(), translateBinaryGeoPredicate(), translateCardinality(), translateCurrentDate(), translateCurrentTime(), translateCurrentTimestamp(), translateCurrentUser(), translateDateadd(), translateDatediff(), translateDatepart(), translateDatetime(), translateExtract(), translateFunctionArgs(), translateFunctionWithGeoArg(), translateGeoProjection(), translateHPTLiteral(), translateItem(), translateKeyForString(), translateLength(), translateLike(), translateLikely(), translateMLPredict(), translateOffsetInFragment(), translatePCAProject(), translateRegexp(), translateSampleRatio(), translateScalarRex(), translateSign(), translateStringOper(), translateTernaryGeoFunction(), translateUnaryGeoConstructor(), translateUnaryGeoFunction(), translateUnaryGeoPredicate(), translateUnlikely(), translateWidthBucket(), and logger::WARNING.
|
private |
Definition at line 2818 of file RelAlgTranslator.cpp.
References run_benchmark_import::args, RexOperator::getOperand(), RexOperator::size(), and translateScalarRex().
Referenced by translateArrayFunction(), translateFunction(), translateKeyForString(), and translateStringOper().
|
private |
Definition at line 1773 of file RelAlgTranslatorGeo.cpp.
References run_benchmark_import::args, CHECK, CHECK_EQ, func_resolve, Geospatial::get_compression_scheme(), RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::getType(), Datum::intval, kINT, kPOINT, RexOperator::size(), translateGeoFunctionArg(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1882 of file RelAlgTranslatorGeo.cpp.
References CHECK, CHECK_EQ, CHECK_GT, SQLTypeInfo::get_type(), RexOperator::getOperand(), kBBOX_INTERSECT, kBOOLEAN, kONE, kPOINT, RexOperator::size(), and translateGeoColumn().
Referenced by translateBoundingBoxIntersectOper().
|
private |
Definition at line 28 of file RelAlgTranslatorGeo.cpp.
References run_benchmark_import::args, CHECK, CHECK_GE, CHECK_LT, SQLTypeInfo::get_physical_coord_cols(), SQLTypeInfo::get_type(), RexAbstractInput::getIndex(), RexInput::getSourceNode(), SQLTypeInfo::has_bounds(), input_to_nest_level_, IS_GEO, and SPIMAP_GEO_PHYSICAL_INPUT.
Referenced by translateBinaryGeoFunction(), translateGeoBoundingBoxIntersectOper(), and translateGeoFunctionArg().
|
private |
Definition at line 1752 of file RelAlgTranslatorGeo.cpp.
References fold_expr(), RexOperator::getOperand(), RexOperator::getOperator(), kBOOLEAN, kDOUBLE, kONE, RexOperator::size(), and translateScalarRex().
Referenced by translateOper().
|
private |
Definition at line 273 of file RelAlgTranslatorGeo.cpp.
References run_benchmark_import::args, CHECK, CHECK_EQ, CHECK_GE, Geospatial::GeoTypesFactory::createGeoType(), fold_expr(), func_resolve, SQLTypeInfo::get_compression(), SQLTypeInfo::get_input_srid(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_subtype(), Analyzer::anonymous_namespace{Analyzer.cpp}::get_ti_from_geo(), SQLTypeInfo::get_type(), IS_GEO, anonymous_namespace{RelAlgExecutor.cpp}::is_projection(), IS_STRING, spatial_type::Transform::isUtm(), kARRAY, kCAST, kDOUBLE, kENCODING_GEOINT, kENCODING_NONE, kGEOGRAPHY, kGEOMETRY, kINT, kLINESTRING, kNULLT, kPOINT, kSMALLINT, kTEXT, kTINYINT, SQLTypeInfo::set_comp_param(), SQLTypeInfo::set_compression(), SQLTypeInfo::set_input_srid(), SQLTypeInfo::set_notnull(), SQLTypeInfo::set_output_srid(), SQLTypeInfo::set_subtype(), SQLTypeInfo::set_type(), to_string(), translateBinaryGeoConstructor(), translateBinaryGeoPredicate(), translateGeoColumn(), translateGeoLiteral(), translateInput(), translateLiteral(), translateScalarRex(), translateUnaryGeoConstructor(), and translateUnaryGeoPredicate().
Referenced by translateBinaryGeoConstructor(), translateBinaryGeoFunction(), translateBinaryGeoPredicate(), translateFunctionWithGeoArg(), translateGeoProjection(), translateTernaryGeoFunction(), translateUnaryGeoConstructor(), translateUnaryGeoFunction(), and translateUnaryGeoPredicate().
|
private |
Definition at line 117 of file RelAlgTranslatorGeo.cpp.
References run_benchmark_import::args, CHECK, Geospatial::compress_coords(), Datum::doubleval, SQLTypeInfo::get_compression(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_type(), Geospatial::GeoTypesFactory::getGeoColumns(), SQLTypeInfo::has_bounds(), Datum::intval, kARRAY, kDOUBLE, kENCODING_GEOINT, kGEOMETRY, kINT, kMULTILINESTRING, kMULTIPOLYGON, kPOLYGON, kTEXT, kTINYINT, SQLTypeInfo::set_comp_param(), SQLTypeInfo::set_compression(), SQLTypeInfo::set_input_srid(), SQLTypeInfo::set_output_srid(), SQLTypeInfo::set_size(), SQLTypeInfo::set_subtype(), Datum::tinyintval, and translateLiteral().
Referenced by translateGeoFunctionArg().
|
private |
Definition at line 884 of file RelAlgTranslatorGeo.cpp.
References CHECK, RelRexToStringConfig::defaults(), func_resolve, RexFunctionOperator::getName(), RexOperator::getOperand(), Geospatial::GeoBase::kPROJECTION, RexFunctionOperator::toString(), and translateGeoFunctionArg().
Referenced by translateFunction().
|
private |
Definition at line 2870 of file RelAlgTranslator.cpp.
References CHECK_EQ, RexOperator::getOperand(), RexOperator::getType(), RexOperator::size(), to_string(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 719 of file RelAlgTranslator.cpp.
References CHECK, CHECK_EQ, anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv(), g_enable_watchdog, g_in_clause_num_elem_skip_bitmap, g_watchdog_in_clause_max_num_elem_non_bitmap, anonymous_namespace{RelAlgTranslator.cpp}::get_in_values_expr(), getInIntegerSetExpr(), RexOperator::getOperand(), just_explain_, kCAST, kENCODING_DICT, kENCODING_NONE, run_benchmark_import::result, RexOperator::size(), timer_start(), timer_stop(), toString(), translateScalarRex(), and VLOG.
Referenced by translateOper().
|
private |
Definition at line 503 of file RelAlgTranslator.cpp.
References CHECK, CHECK_EQ, CHECK_GE, CHECK_LE, CHECK_LT, RelRexToStringConfig::defaults(), RexAbstractInput::getIndex(), RelAlgNode::getOutputMetainfo(), RexInput::getSourceNode(), input_to_nest_level_, join_types_, kTEXT, and LEFT.
Referenced by translateGeoFunctionArg().
|
private |
Definition at line 2570 of file RelAlgTranslator.cpp.
References Datum::bigintval, CHECK, CHECK_EQ, CHECK_NE, daINVALID, anonymous_namespace{RelAlgTranslator.cpp}::determineTimeUnit(), anonymous_namespace{RelAlgTranslator.cpp}::determineTimeValMultiplierForTimeType(), kBIGINT, kDATE, kDAY, kDECIMAL, kDOUBLE, kHOUR, kINT, kMINUTE, kMONTH, kMULTIPLY, kNUMERIC, kSECOND, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, kYEAR, to_dateadd_field(), and UNREACHABLE.
Referenced by translateWindowFunction().
|
private |
Definition at line 1631 of file RelAlgTranslator.cpp.
References CHECK_EQ, RexOperator::getOperand(), kARRAY_AT, kONE, RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1486 of file RelAlgTranslator.cpp.
References run_benchmark_import::args, CHECK_EQ, RexFunctionOperator::getName(), kUNNEST, and translateFunctionArgs().
Referenced by translateFunction().
|
private |
Definition at line 1478 of file RelAlgTranslator.cpp.
References CHECK_EQ, RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1227 of file RelAlgTranslator.cpp.
References CHECK, Parser::LikeExpr::get(), RexFunctionOperator::getName(), RexOperator::getOperand(), RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1256 of file RelAlgTranslator.cpp.
References CHECK, RexOperator::getOperand(), RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
static |
Definition at line 366 of file RelAlgTranslator.cpp.
References Parser::StringLiteral::analyzeValue(), Parser::IntLiteral::analyzeValue(), Parser::FixedPtLiteral::analyzeValue(), run_benchmark_import::args, Datum::bigintval, Datum::boolval, anonymous_namespace{RelAlgTranslator.cpp}::build_type_info(), Datum::doubleval, logger::FATAL, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kGEOMETRY, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNULLT, kTEXT, kTIME, kTIMESTAMP, LOG, and make_fp_constant().
Referenced by ResultSetLogicalValuesBuilder::build(), translateGeoFunctionArg(), and translateGeoLiteral().
|
private |
Definition at line 1153 of file RelAlgTranslator.cpp.
References CHECK_GE, RexOperator::getOperand(), RexOperator::size(), and translateScalarRex().
Referenced by translateFunction().
|
private |
Definition at line 1712 of file RelAlgTranslator.cpp.
Referenced by translateFunction().
|
private |
Definition at line 1079 of file RelAlgTranslator.cpp.
References CHECK, CHECK_GT, executor_, RexOperator::getOperand(), RexOperator::getOperator(), getQuantifiedRhs(), IS_COMPARISON, kBBOX_INTERSECT, kIN, kMINUS, kONE, kPLUS, Parser::OperExpr::normalize(), RexOperator::size(), translateBoundingBoxIntersectOper(), translateDatePlusMinus(), translateGeoComparison(), translateInOper(), translateScalarRex(), and translateUoper().