385 if (left_expr->get_type_info().is_date_in_days() ||
386 right_expr->get_type_info().is_date_in_days()) {
388 left_expr = left_expr->decompress();
389 right_expr = right_expr->decompress();
391 const auto& left_type = left_expr->get_type_info();
392 auto right_type = right_expr->get_type_info();
395 CHECK(!std::dynamic_pointer_cast<Analyzer::Subquery>(right_expr));
396 if (right_type.get_type() !=
kARRAY) {
397 throw std::runtime_error(
398 "Existential or universal qualifiers can only be used in front of a subquery "
400 "expression of array type.");
402 right_type = right_type.get_elem_type();
407 optype, left_type, right_type, &new_left_type, &new_right_type);
408 if (result_type.is_timeinterval()) {
409 return makeExpr<Analyzer::BinOper>(
410 result_type,
false, optype, qual, left_expr, right_expr);
412 if (left_type != new_left_type) {
413 left_expr = left_expr->add_cast(new_left_type);
415 if (right_type != new_right_type) {
417 right_expr = right_expr->add_cast(new_right_type);
419 right_expr = right_expr->add_cast(new_right_type.
get_array_type());
426 throw std::runtime_error(
427 "Comparison operators are not yet supported for geospatial types.");
433 if (optype ==
kEQ || optype ==
kNE) {
445 auto& expr_to_cast = ti == new_left_type ? right_expr : left_expr;
447 ti.set_dict_intersection();
448 expr_to_cast = expr_to_cast->add_cast(ti);
453 left_expr = left_expr->decompress();
454 right_expr = right_expr->decompress();
460 left_expr = left_expr->decompress();
461 right_expr = right_expr->decompress();
464 if (!(optype ==
kEQ || optype ==
kNE)) {
467 left_expr = left_expr->decompress();
468 right_expr = right_expr->decompress();
482 right_expr = right_expr->add_cast(ti);
490 left_expr = left_expr->add_cast(ti);
492 left_expr = left_expr->decompress();
493 right_expr = right_expr->decompress();
497 left_expr = left_expr->decompress();
498 right_expr = right_expr->decompress();
500 bool has_agg = (left_expr->get_contains_agg() || right_expr->get_contains_agg());
501 return makeExpr<Analyzer::BinOper>(
502 result_type, has_agg, optype, qual, left_expr, right_expr);
bool should_translate_strings(const std::shared_ptr< Analyzer::Expr > &lhs_expr, const std::shared_ptr< Analyzer::Expr > &rhs_expr)
SQLTypeInfo get_array_type() const
HOST DEVICE EncodingType get_compression() const
HOST DEVICE int get_comp_param() const
static SQLTypeInfo analyze_type_info(SQLOps op, const SQLTypeInfo &left_type, const SQLTypeInfo &right_type, SQLTypeInfo *new_left_type, SQLTypeInfo *new_right_type)
SQLTypeInfo const & get_str_dict_cast_type(const SQLTypeInfo &lhs_type_info, const SQLTypeInfo &rhs_type_info, const Executor *executor)
const shared::StringDictKey & getStringDictKey() const