Skip to content

Commit 24073f4

Browse files
zhjwpkuwgtmac
authored andcommitted
resolve review comments
1 parent c83440a commit 24073f4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/iceberg/json_serde.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,10 @@ Result<std::unique_ptr<Type>> TypeFromJson(const nlohmann::json& json) {
546546
}
547547
return JsonParseError("Invalid decimal type: {}", type_str);
548548
} else if (lower_type_str.starts_with("geometry")) {
549-
static const std::regex geometry_regex(R"(\s*(?:\(\s*([^)]*?)\s*\))?)");
549+
static const std::regex geometry_regex(R"(geometry\s*(?:\(\s*([^)]*?)\s*\))?)",
550+
std::regex_constants::icase);
550551
std::smatch match;
551-
const auto type_params = type_str.substr(std::string_view("geometry").size());
552-
if (std::regex_match(type_params, match, geometry_regex)) {
552+
if (std::regex_match(type_str, match, geometry_regex)) {
553553
if (match[1].matched) {
554554
auto crs = match[1].str();
555555
if (crs.empty()) {
@@ -562,10 +562,10 @@ Result<std::unique_ptr<Type>> TypeFromJson(const nlohmann::json& json) {
562562
return JsonParseError("Invalid geometry type: {}", type_str);
563563
} else if (lower_type_str.starts_with("geography")) {
564564
static const std::regex geography_regex(
565-
R"(\s*(?:\(\s*([^,]*?)\s*(?:,\s*(\w*)\s*)?\))?)");
565+
R"(geography\s*(?:\(\s*([^,]*?)\s*(?:,\s*(\w*)\s*)?\))?)",
566+
std::regex_constants::icase);
566567
std::smatch match;
567-
const auto type_params = type_str.substr(std::string_view("geography").size());
568-
if (std::regex_match(type_params, match, geography_regex)) {
568+
if (std::regex_match(type_str, match, geography_regex)) {
569569
auto crs = match[1].str();
570570
if (match[1].matched && crs.empty()) {
571571
return JsonParseError("Invalid geography type: {}", type_str);

0 commit comments

Comments
 (0)