277 if (left_expr->get_type_info().is_date_in_days() ||
278 right_expr->get_type_info().is_date_in_days()) {
280 left_expr = left_expr->decompress();
281 right_expr = right_expr->decompress();
283 const auto& left_type = left_expr->get_type_info();
284 auto right_type = right_expr->get_type_info();
287 CHECK(!std::dynamic_pointer_cast<Analyzer::Subquery>(right_expr));
288 if (right_type.get_type() !=
kARRAY) {
289 throw std::runtime_error(
290 "Existential or universal qualifiers can only be used in front of a subquery "
292 "expression of array type.");
294 right_type = right_type.get_elem_type();
299 optype, left_type, right_type, &new_left_type, &new_right_type);
300 if (result_type.is_timeinterval()) {
301 return makeExpr<Analyzer::BinOper>(
302 result_type,
false,
optype, qual, left_expr, right_expr);
304 if (left_type != new_left_type) {
305 left_expr = left_expr->add_cast(new_left_type);
307 if (right_type != new_right_type) {
309 right_expr = right_expr->add_cast(new_right_type);
311 right_expr = right_expr->add_cast(new_right_type.
get_array_type());
318 throw std::runtime_error(
319 "Comparison operators are not yet supported for geospatial types.");
332 right_expr = right_expr->add_cast(ti);
339 left_expr = left_expr->add_cast(ti);
341 left_expr = left_expr->decompress();
342 right_expr = right_expr->decompress();
345 left_expr = left_expr->decompress();
346 right_expr = right_expr->decompress();
348 bool has_agg = (left_expr->get_contains_agg() || right_expr->get_contains_agg());
349 return makeExpr<Analyzer::BinOper>(
350 result_type, has_agg,
optype, qual, left_expr, right_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)