| 583 | } |
| 584 | |
| 585 | Node::Ptr ZVecSQLParser::handle_const_num_and_str_node(VoidPtr node) { |
| 586 | Node::Ptr const_expr = nullptr; |
| 587 | SQLParser::Constant_num_and_strContext *constant_num_and_str_node = |
| 588 | reinterpret_cast<SQLParser::Constant_num_and_strContext *>(node); |
| 589 | if (constant_num_and_str_node->numeric()) { |
| 590 | const_expr = std::make_shared<ConstantNode>( |
| 591 | constant_num_and_str_node->numeric()->getText()); |
| 592 | if (constant_num_and_str_node->numeric()->int_value()) { |
| 593 | const_expr->set_op(NodeOp::T_INT_VALUE); |
| 594 | } else if (constant_num_and_str_node->numeric()->float_value()) { |
| 595 | const_expr->set_op(NodeOp::T_FLOAT_VALUE); |
| 596 | } |
| 597 | } else if (constant_num_and_str_node->quoted_string()) { |
| 598 | std::string value = constant_num_and_str_node->quoted_string()->getText(); |
| 599 | value = trim(value); |
| 600 | value = Util::normalize(value); |
| 601 | const_expr = std::make_shared<ConstantNode>(value); |
| 602 | const_expr->set_op(NodeOp::T_STRING_VALUE); |
| 603 | } |
| 604 | |
| 605 | return const_expr; |
| 606 | } |
| 607 | |
| 608 | Node::Ptr ZVecSQLParser::handle_vector_expr_node(VoidPtr node) { |
| 609 | SQLParser::Vector_exprContext *vector_expr_node = |
nothing calls this directly
no test coverage detected