paleolimbot commented on code in PR #45459: URL: https://github.com/apache/arrow/pull/45459#discussion_r2040427563
########## cpp/src/parquet/geospatial/util_json_internal.cc: ########## @@ -0,0 +1,211 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "parquet/geospatial/util_json_internal.h" + +#include <string> + +#include "arrow/extension_type.h" +#include "arrow/json/rapidjson_defs.h" // IWYU pragma: keep +#include "arrow/result.h" +#include "arrow/util/string.h" + +#include <rapidjson/document.h> +#include <rapidjson/writer.h> + +#include "parquet/exception.h" +#include "parquet/types.h" + +namespace parquet { + +namespace { +::arrow::Result<std::shared_ptr<const LogicalType>> ParseGeoArrowJSON( + std::string_view serialized_data); +} + +::arrow::Result<std::shared_ptr<const LogicalType>> LogicalTypeFromGeoArrowMetadata( + std::string_view serialized_data) { + // Handle a few hard-coded cases so that the tests can run/users can write the default + // LogicalType::Geometry() even if ARROW_JSON is not defined. + if (serialized_data.empty() || serialized_data == "{}") { + return LogicalType::Geometry(); + } else if ( + serialized_data == + R"({"edges": "spherical", "crs": "OGC:CRS84", "crs_type": "authority_code"})") { Review Comment: I removed this...it was left over from when I wanted the tests to pass when ARROW_JSON was not ON. This is handled by the JSON parser now. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org