Drabble commented on code in PR #855: URL: https://github.com/apache/incubator-baremaps/pull/855#discussion_r1619135943
########## baremaps-geoparquet/src/main/java/org/apache/baremaps/geoparquet/GeoParquetReader.java: ########## @@ -0,0 +1,277 @@ +/* + * 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. + */ + +package org.apache.baremaps.geoparquet; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.*; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.function.Consumer; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import org.apache.baremaps.geoparquet.data.GeoParquetGroup; +import org.apache.baremaps.geoparquet.data.GeoParquetGroup.Schema; +import org.apache.baremaps.geoparquet.data.GeoParquetGroupFactory; +import org.apache.baremaps.geoparquet.data.GeoParquetMetadata; +import org.apache.baremaps.geoparquet.hadoop.GeoParquetGroupReadSupport; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import org.apache.parquet.hadoop.ParquetFileReader; +import org.apache.parquet.hadoop.ParquetReader; +import org.apache.parquet.schema.MessageType; + + +/** + * This reader is based on the parquet example code located at: org.apache.parquet.example.data.*. + */ +public class GeoParquetReader { + + private final URI uri; + + private final Configuration configuration; + + private Map<FileStatus, FileInfo> files; + + private record FileInfo(FileStatus file, Long recordCount, Map<String, String> keyValueMetadata, + MessageType messageType, GeoParquetMetadata metadata, + GeoParquetGroup.Schema geoParquetSchema) { + } + + public GeoParquetReader(URI uri) { + this(uri, createConfiguration()); + } + + public GeoParquetReader(URI uri, Configuration configuration) { + this.uri = uri; + this.configuration = configuration; + } + + public MessageType getParquetSchema() throws IOException, URISyntaxException { + return files().values().stream() Review Comment: Do you think we will have a different Geoparquet DataTable for each theme / subtheme? I think each that sub theme will have a different schema. https://docs.overturemaps.org/schema/reference/ For example water inside the base theme has a is_salt property and land has an elevation property. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
