1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // with the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+
118use std:: collections:: HashMap ;
219use std:: sync:: Arc ;
320
4- use arrow_array:: {
5- ArrayRef , Float64Array , Int32Array , LargeBinaryArray , StringArray ,
6- } ;
21+ use arrow_array:: { ArrayRef , Float64Array , Int32Array , LargeBinaryArray , StringArray } ;
722use futures:: TryStreamExt ;
823use geo_types:: { Geometry , Point } ;
924use iceberg:: spec:: { NestedField , PrimitiveType , Schema , Type } ;
25+ use iceberg:: writer:: IcebergWriterBuilder ;
1026use iceberg:: writer:: base_writer:: data_file_writer:: DataFileWriterBuilder ;
1127use iceberg:: writer:: file_writer:: ParquetWriterBuilder ;
1228use iceberg:: writer:: file_writer:: location_generator:: {
1329 DefaultFileNameGenerator , DefaultLocationGenerator ,
1430} ;
1531use iceberg:: writer:: file_writer:: rolling_writer:: RollingFileWriterBuilder ;
16- use iceberg:: writer:: IcebergWriterBuilder ;
1732use iceberg:: { Catalog , CatalogBuilder , NamespaceIdent , TableCreation , TableIdent } ;
1833use iceberg_catalog_rest:: { REST_CATALOG_PROP_URI , RestCatalogBuilder } ;
1934use parquet:: file:: properties:: WriterProperties ;
@@ -22,6 +37,13 @@ static REST_URI: &str = "http://localhost:8181";
2237static NAMESPACE : & str = "ns1" ;
2338static TABLE_NAME : & str = "cities_table2" ;
2439
40+ //This is an example of creating and loading an table using a schema with
41+ // geo types via the Iceberg REST Catalog.
42+ //
43+ /// A running instance of the iceberg-rest catalog on port 8181 is required. You can find how to run
44+ /// the iceberg-rest catalog with `docker compose` in the official
45+ /// [quickstart documentation](https://iceberg.apache.org/spark-quickstart/).
46+
2547#[ derive( Debug , Clone ) ]
2648struct GeoFeature {
2749 id : i32 ,
0 commit comments