Skip to content

Commit 27ae524

Browse files
committed
chore: add license header + comments
1 parent 5bbbcc2 commit 27ae524

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

crates/examples/src/geo_rest_catalog.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
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+
118
use std::collections::HashMap;
219
use std::sync::Arc;
320

4-
use arrow_array::{
5-
ArrayRef, Float64Array, Int32Array, LargeBinaryArray, StringArray,
6-
};
21+
use arrow_array::{ArrayRef, Float64Array, Int32Array, LargeBinaryArray, StringArray};
722
use futures::TryStreamExt;
823
use geo_types::{Geometry, Point};
924
use iceberg::spec::{NestedField, PrimitiveType, Schema, Type};
25+
use iceberg::writer::IcebergWriterBuilder;
1026
use iceberg::writer::base_writer::data_file_writer::DataFileWriterBuilder;
1127
use iceberg::writer::file_writer::ParquetWriterBuilder;
1228
use iceberg::writer::file_writer::location_generator::{
1329
DefaultFileNameGenerator, DefaultLocationGenerator,
1430
};
1531
use iceberg::writer::file_writer::rolling_writer::RollingFileWriterBuilder;
16-
use iceberg::writer::IcebergWriterBuilder;
1732
use iceberg::{Catalog, CatalogBuilder, NamespaceIdent, TableCreation, TableIdent};
1833
use iceberg_catalog_rest::{REST_CATALOG_PROP_URI, RestCatalogBuilder};
1934
use parquet::file::properties::WriterProperties;
@@ -22,6 +37,13 @@ static REST_URI: &str = "http://localhost:8181";
2237
static NAMESPACE: &str = "ns1";
2338
static 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)]
2648
struct GeoFeature {
2749
id: i32,

0 commit comments

Comments
 (0)