| 698 | static LogicalType parseDecimalType(const std::string& trimmedStr); |
| 699 | |
| 700 | bool LogicalType::isBuiltInType(const std::string& str) { |
| 701 | auto trimmedStr = StringUtils::ltrim(StringUtils::rtrim(str)); |
| 702 | auto upperDataTypeString = StringUtils::getUpper(trimmedStr); |
| 703 | auto id = LogicalTypeID::ANY; |
| 704 | try { |
| 705 | if (upperDataTypeString.ends_with("[]")) { |
| 706 | parseListType(trimmedStr); |
| 707 | } else if (upperDataTypeString.ends_with("]")) { |
| 708 | parseArrayType(trimmedStr); |
| 709 | } else if (upperDataTypeString.starts_with("STRUCT")) { |
| 710 | parseStructType(trimmedStr); |
| 711 | } else if (upperDataTypeString.starts_with("MAP")) { |
| 712 | parseMapType(trimmedStr); |
| 713 | } else if (upperDataTypeString.starts_with("UNION")) { |
| 714 | parseUnionType(trimmedStr); |
| 715 | } else if (upperDataTypeString.starts_with("DECIMAL") || |
| 716 | upperDataTypeString.starts_with("NUMERIC")) { |
| 717 | parseDecimalType(trimmedStr); |
| 718 | } else if (!tryGetIDFromString(upperDataTypeString, id)) { |
| 719 | return false; |
| 720 | } |
| 721 | } catch (...) { |
| 722 | return false; |
| 723 | } |
| 724 | return true; |
| 725 | } |
| 726 | |
| 727 | LogicalType LogicalType::convertFromString(const std::string& str, main::ClientContext* context) { |
| 728 | LogicalType type; |
nothing calls this directly
no test coverage detected