This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new 30d4db1 deploy: be65c89001307d56e1c7f2ca000ef17e026e7c23
30d4db1 is described below
commit 30d4db154cdf4f0db2ee9a153719cdc7fe390d07
Author: Fokko <[email protected]>
AuthorDate: Wed Jan 31 07:29:26 2024 +0000
deploy: be65c89001307d56e1c7f2ca000ef17e026e7c23
---
404.html | 2 +-
CONTRIBUTING.html | 6 +-
api.html | 534 +++++++++++++++++++++++++++++++++++++++++++++++
download.html | 6 +-
index.html | 2 +-
install.html | 2 +-
introduction.html | 2 +-
print.html | 303 ++++++++++++++++++++++++++-
reference/setup_gpg.html | 2 +-
release.html | 2 +-
searchindex.js | 2 +-
searchindex.json | 2 +-
12 files changed, 850 insertions(+), 15 deletions(-)
diff --git a/404.html b/404.html
index 7c8ca0e..7b59b74 100644
--- a/404.html
+++ b/404.html
@@ -89,7 +89,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded affix
"><li class="part-title">Developer Guide</li><li class="chapter-item expanded
"><a href="CONTRIBUTING.ht [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded "><a
href="api.html">API</a></li><li class="chapter-item expanded affix "><li
class="part-title">Developer Gui [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html
index cb613f1..2812447 100644
--- a/CONTRIBUTING.html
+++ b/CONTRIBUTING.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded affix
"><li class="part-title">Developer Guide</li><li class="chapter-item expanded
"><a href="CONTRIBUTING.ht [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded "><a
href="api.html">API</a></li><li class="chapter-item expanded affix "><li
class="part-title">Developer Gui [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
@@ -284,7 +284,7 @@ cargo 1.69.0 (6e9a83356 2023-04-12)
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
- <a rel="prev" href="download.html"
class="mobile-nav-chapters previous" title="Previous chapter"
aria-label="Previous chapter" aria-keyshortcuts="Left">
+ <a rel="prev" href="api.html"
class="mobile-nav-chapters previous" title="Previous chapter"
aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
@@ -298,7 +298,7 @@ cargo 1.69.0 (6e9a83356 2023-04-12)
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
- <a rel="prev" href="download.html" class="nav-chapters
previous" title="Previous chapter" aria-label="Previous chapter"
aria-keyshortcuts="Left">
+ <a rel="prev" href="api.html" class="nav-chapters
previous" title="Previous chapter" aria-label="Previous chapter"
aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
diff --git a/api.html b/api.html
new file mode 100644
index 0000000..4a69aa2
--- /dev/null
+++ b/api.html
@@ -0,0 +1,534 @@
+<!DOCTYPE HTML>
+<html lang="en" class="light" dir="ltr">
+ <head>
+ <!-- Book generated using mdBook -->
+ <meta charset="UTF-8">
+ <title>API - Iceberg Rust</title>
+
+
+ <!-- Custom HTML head -->
+
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="theme-color" content="#ffffff">
+
+ <link rel="icon" href="favicon.svg">
+ <link rel="shortcut icon" href="favicon.png">
+ <link rel="stylesheet" href="css/variables.css">
+ <link rel="stylesheet" href="css/general.css">
+ <link rel="stylesheet" href="css/chrome.css">
+ <link rel="stylesheet" href="css/print.css" media="print">
+
+ <!-- Fonts -->
+ <link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
+ <link rel="stylesheet" href="fonts/fonts.css">
+
+ <!-- Highlight.js Stylesheets -->
+ <link rel="stylesheet" href="highlight.css">
+ <link rel="stylesheet" href="tomorrow-night.css">
+ <link rel="stylesheet" href="ayu-highlight.css">
+
+ <!-- Custom theme stylesheets -->
+
+ </head>
+ <body class="sidebar-visible no-js">
+ <div id="body-container">
+ <!-- Provide site root to javascript -->
+ <script>
+ var path_to_root = "";
+ var default_theme = window.matchMedia("(prefers-color-scheme:
dark)").matches ? "navy" : "light";
+ </script>
+
+ <!-- Work around some values being stored in localStorage wrapped in
quotes -->
+ <script>
+ try {
+ var theme = localStorage.getItem('mdbook-theme');
+ var sidebar = localStorage.getItem('mdbook-sidebar');
+
+ if (theme.startsWith('"') && theme.endsWith('"')) {
+ localStorage.setItem('mdbook-theme', theme.slice(1,
theme.length - 1));
+ }
+
+ if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
+ localStorage.setItem('mdbook-sidebar', sidebar.slice(1,
sidebar.length - 1));
+ }
+ } catch (e) { }
+ </script>
+
+ <!-- Set the theme before any content is loaded, prevents flash -->
+ <script>
+ var theme;
+ try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
+ if (theme === null || theme === undefined) { theme =
default_theme; }
+ var html = document.querySelector('html');
+ html.classList.remove('light')
+ html.classList.add(theme);
+ var body = document.querySelector('body');
+ body.classList.remove('no-js')
+ body.classList.add('js');
+ </script>
+
+ <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
+
+ <!-- Hide / unhide sidebar before it is displayed -->
+ <script>
+ var body = document.querySelector('body');
+ var sidebar = null;
+ var sidebar_toggle =
document.getElementById("sidebar-toggle-anchor");
+ if (document.body.clientWidth >= 1080) {
+ try { sidebar = localStorage.getItem('mdbook-sidebar'); }
catch(e) { }
+ sidebar = sidebar || 'visible';
+ } else {
+ sidebar = 'hidden';
+ }
+ sidebar_toggle.checked = sidebar === 'visible';
+ body.classList.remove('sidebar-visible');
+ body.classList.add("sidebar-" + sidebar);
+ </script>
+
+ <nav id="sidebar" class="sidebar" aria-label="Table of contents">
+ <div class="sidebar-scrollbox">
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded "><a
href="api.html" class="active">API</a></li><li class="chapter-item expanded
affix "><li class="part-title [...]
+ </div>
+ <div id="sidebar-resize-handle" class="sidebar-resize-handle">
+ <div class="sidebar-resize-indicator"></div>
+ </div>
+ </nav>
+
+ <!-- Track and set sidebar scroll position -->
+ <script>
+ var sidebarScrollbox = document.querySelector('#sidebar
.sidebar-scrollbox');
+ sidebarScrollbox.addEventListener('click', function(e) {
+ if (e.target.tagName === 'A') {
+ sessionStorage.setItem('sidebar-scroll',
sidebarScrollbox.scrollTop);
+ }
+ }, { passive: true });
+ var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
+ sessionStorage.removeItem('sidebar-scroll');
+ if (sidebarScrollTop) {
+ // preserve sidebar scroll position when navigating via links
within sidebar
+ sidebarScrollbox.scrollTop = sidebarScrollTop;
+ } else {
+ // scroll sidebar to current active section when navigating
via "next/previous chapter" buttons
+ var activeSection = document.querySelector('#sidebar .active');
+ if (activeSection) {
+ activeSection.scrollIntoView({ block: 'center' });
+ }
+ }
+ </script>
+
+ <div id="page-wrapper" class="page-wrapper">
+
+ <div class="page">
+ <div id="menu-bar-hover-placeholder"></div>
+ <div id="menu-bar" class="menu-bar sticky">
+ <div class="left-buttons">
+ <label id="sidebar-toggle" class="icon-button"
for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle
Table of Contents" aria-controls="sidebar">
+ <i class="fa fa-bars"></i>
+ </label>
+ <button id="theme-toggle" class="icon-button"
type="button" title="Change theme" aria-label="Change theme"
aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
+ <i class="fa fa-paint-brush"></i>
+ </button>
+ <ul id="theme-list" class="theme-popup"
aria-label="Themes" role="menu">
+ <li role="none"><button role="menuitem"
class="theme" id="light">Light</button></li>
+ <li role="none"><button role="menuitem"
class="theme" id="rust">Rust</button></li>
+ <li role="none"><button role="menuitem"
class="theme" id="coal">Coal</button></li>
+ <li role="none"><button role="menuitem"
class="theme" id="navy">Navy</button></li>
+ <li role="none"><button role="menuitem"
class="theme" id="ayu">Ayu</button></li>
+ </ul>
+ <button id="search-toggle" class="icon-button"
type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar"
aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
+ <i class="fa fa-search"></i>
+ </button>
+ </div>
+
+ <h1 class="menu-title">Iceberg Rust</h1>
+
+ <div class="right-buttons">
+ <a href="print.html" title="Print this book"
aria-label="Print this book">
+ <i id="print-button" class="fa fa-print"></i>
+ </a>
+ <a href="https://github.com/apache/iceberg-rust"
title="Git repository" aria-label="Git repository">
+ <i id="git-repository-button" class="fa
fa-github"></i>
+ </a>
+ <a
href="https://github.com/apache/iceberg-rust/edit/main/website/src/api.md"
title="Suggest an edit" aria-label="Suggest an edit">
+ <i id="git-edit-button" class="fa fa-edit"></i>
+ </a>
+
+ </div>
+ </div>
+
+ <div id="search-wrapper" class="hidden">
+ <form id="searchbar-outer" class="searchbar-outer">
+ <input type="search" id="searchbar" name="searchbar"
placeholder="Search this book ..." aria-controls="searchresults-outer"
aria-describedby="searchresults-header">
+ </form>
+ <div id="searchresults-outer" class="searchresults-outer
hidden">
+ <div id="searchresults-header"
class="searchresults-header"></div>
+ <ul id="searchresults">
+ </ul>
+ </div>
+ </div>
+
+ <!-- Apply ARIA attributes after the sidebar and the sidebar
toggle button are added to the DOM -->
+ <script>
+
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar
=== 'visible');
+
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !==
'visible');
+ Array.from(document.querySelectorAll('#sidebar
a')).forEach(function(link) {
+ link.setAttribute('tabIndex', sidebar === 'visible' ?
0 : -1);
+ });
+ </script>
+
+ <div id="content" class="content">
+ <main>
+ <!--
+ ~ 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.
+-->
+<h1 id="catalog"><a class="header" href="#catalog">Catalog</a></h1>
+<p><code>Catalog</code> is the entry point for accessing iceberg tables. You
can use a catalog to:</p>
+<ul>
+<li>Create and list namespaces.</li>
+<li>Create, load, and drop tables</li>
+</ul>
+<p>Currently only rest catalog has been implemented, and other catalogs are
under active development. Here is an
+example of how to create a <code>RestCatalog</code>:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span> // Create catalog
+ let config = RestCatalogConfig::builder()
+ .uri("http://localhost:8080".to_string())
+ .build();
+
+ let catalog = RestCatalog::new(config).await.unwrap();
+<span class="boring">
+</span><span class="boring"> // List all namespaces
+</span><span class="boring"> let all_namespaces =
catalog.list_namespaces(None).await.unwrap();
+</span><span class="boring"> println!("Namespaces in current catalog:
{:?}", all_namespaces);
+</span><span class="boring">
+</span><span class="boring"> let namespace_id =
+</span><span class="boring">
NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+</span><span class="boring"> // Create namespace
+</span><span class="boring"> let ns = catalog
+</span><span class="boring"> .create_namespace(
+</span><span class="boring"> &namespace_id,
+</span><span class="boring">
HashMap::from([("key1".to_string(), "value1".to_string())]),
+</span><span class="boring"> )
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Namespace created: {:?}",
ns);
+</span><span class="boring">}</span></code></pre>
+<p>You can run following code to list all root namespaces:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span> // List all namespaces
+ let all_namespaces = catalog.list_namespaces(None).await.unwrap();
+ println!("Namespaces in current catalog: {:?}", all_namespaces);
+<span class="boring">
+</span><span class="boring"> let namespace_id =
+</span><span class="boring">
NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+</span><span class="boring"> // Create namespace
+</span><span class="boring"> let ns = catalog
+</span><span class="boring"> .create_namespace(
+</span><span class="boring"> &namespace_id,
+</span><span class="boring">
HashMap::from([("key1".to_string(), "value1".to_string())]),
+</span><span class="boring"> )
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Namespace created: {:?}",
ns);
+</span><span class="boring">}</span></code></pre>
+<p>Then you can run following code to create namespace:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span><span class="boring"> // List all namespaces
+</span><span class="boring"> let all_namespaces =
catalog.list_namespaces(None).await.unwrap();
+</span><span class="boring"> println!("Namespaces in current catalog:
{:?}", all_namespaces);
+</span><span class="boring">
+</span> let namespace_id =
+ NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+ // Create namespace
+ let ns = catalog
+ .create_namespace(
+ &namespace_id,
+ HashMap::from([("key1".to_string(),
"value1".to_string())]),
+ )
+ .await
+ .unwrap();
+
+ println!("Namespace created: {:?}", ns);
+<span class="boring">}</span></code></pre>
+<h1 id="table"><a class="header" href="#table">Table</a></h1>
+<p>After creating <code>Catalog</code>, we can manipulate tables through
<code>Catalog</code>.</p>
+<p>You can use following code to create a table:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::spec::{NestedField, PrimitiveType,
Schema, Type};
+</span><span class="boring">use iceberg::{Catalog, TableCreation, TableIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span> let table_id = TableIdent::from_strs(["default",
"t1"]).unwrap();
+
+ let table_schema = Schema::builder()
+ .with_fields(vec![
+ NestedField::optional(1, "foo",
Type::Primitive(PrimitiveType::String)).into(),
+ NestedField::required(2, "bar",
Type::Primitive(PrimitiveType::Int)).into(),
+ NestedField::optional(3, "baz",
Type::Primitive(PrimitiveType::Boolean)).into(),
+ ])
+ .with_schema_id(1)
+ .with_identifier_field_ids(vec![2])
+ .build()
+ .unwrap();
+
+ // Create table
+ let table_creation = TableCreation::builder()
+ .name(table_id.name.clone())
+ .schema(table_schema.clone())
+ .properties(HashMap::from([("owner".to_string(),
"testx".to_string())]))
+ .build();
+
+ let table = catalog
+ .create_table(&table_id.namespace, table_creation)
+ .await
+ .unwrap();
+
+ println!("Table created: {:?}", table.metadata());
+<span class="boring">
+</span><span class="boring"> let table2 = catalog
+</span><span class="boring">
.load_table(&TableIdent::from_strs(["default",
"t2"]).unwrap())
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring"> println!("{:?}", table2.metadata());
+</span><span class="boring">}</span></code></pre>
+<p>Also, you can load a table directly:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::spec::{NestedField, PrimitiveType,
Schema, Type};
+</span><span class="boring">use iceberg::{Catalog, TableCreation, TableIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span><span class="boring"> let table_id =
TableIdent::from_strs(["default", "t1"]).unwrap();
+</span><span class="boring">
+</span><span class="boring"> let table_schema = Schema::builder()
+</span><span class="boring"> .with_fields(vec![
+</span><span class="boring"> NestedField::optional(1,
"foo", Type::Primitive(PrimitiveType::String)).into(),
+</span><span class="boring"> NestedField::required(2,
"bar", Type::Primitive(PrimitiveType::Int)).into(),
+</span><span class="boring"> NestedField::optional(3,
"baz", Type::Primitive(PrimitiveType::Boolean)).into(),
+</span><span class="boring"> ])
+</span><span class="boring"> .with_schema_id(1)
+</span><span class="boring"> .with_identifier_field_ids(vec![2])
+</span><span class="boring"> .build()
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> // Create table
+</span><span class="boring"> let table_creation = TableCreation::builder()
+</span><span class="boring"> .name(table_id.name.clone())
+</span><span class="boring"> .schema(table_schema.clone())
+</span><span class="boring">
.properties(HashMap::from([("owner".to_string(),
"testx".to_string())]))
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let table = catalog
+</span><span class="boring"> .create_table(&table_id.namespace,
table_creation)
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Table created: {:?}",
table.metadata());
+</span><span class="boring">
+</span> let table2 = catalog
+ .load_table(&TableIdent::from_strs(["default",
"t2"]).unwrap())
+ .await
+ .unwrap();
+ println!("{:?}", table2.metadata());
+<span class="boring">}</span></code></pre>
+
+ </main>
+
+ <nav class="nav-wrapper" aria-label="Page navigation">
+ <!-- Mobile navigation buttons -->
+ <a rel="prev" href="download.html"
class="mobile-nav-chapters previous" title="Previous chapter"
aria-label="Previous chapter" aria-keyshortcuts="Left">
+ <i class="fa fa-angle-left"></i>
+ </a>
+
+ <a rel="next prefetch" href="CONTRIBUTING.html"
class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter"
aria-keyshortcuts="Right">
+ <i class="fa fa-angle-right"></i>
+ </a>
+
+ <div style="clear: both"></div>
+ </nav>
+ </div>
+ </div>
+
+ <nav class="nav-wide-wrapper" aria-label="Page navigation">
+ <a rel="prev" href="download.html" class="nav-chapters
previous" title="Previous chapter" aria-label="Previous chapter"
aria-keyshortcuts="Left">
+ <i class="fa fa-angle-left"></i>
+ </a>
+
+ <a rel="next prefetch" href="CONTRIBUTING.html"
class="nav-chapters next" title="Next chapter" aria-label="Next chapter"
aria-keyshortcuts="Right">
+ <i class="fa fa-angle-right"></i>
+ </a>
+ </nav>
+
+ </div>
+
+
+
+
+ <script>
+ window.playground_copyable = true;
+ </script>
+
+
+ <script src="elasticlunr.min.js"></script>
+ <script src="mark.min.js"></script>
+ <script src="searcher.js"></script>
+
+ <script src="clipboard.min.js"></script>
+ <script src="highlight.js"></script>
+ <script src="book.js"></script>
+
+ <!-- Custom JS scripts -->
+
+
+ </div>
+ </body>
+</html>
diff --git a/download.html b/download.html
index ad15158..5de2297 100644
--- a/download.html
+++ b/download.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html" class="active">Download</a></li><li class="chapter-item
expanded affix "><li class="part-title">Developer Guide</li><li
class="chapter-item expanded "><a href=" [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html" class="active">Download</a></li><li class="chapter-item
expanded "><a href="api.html">API</a></li><li class="chapter-item expanded
affix "><li class="part-title [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
@@ -206,7 +206,7 @@
<i class="fa fa-angle-left"></i>
</a>
- <a rel="next prefetch" href="CONTRIBUTING.html"
class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter"
aria-keyshortcuts="Right">
+ <a rel="next prefetch" href="api.html"
class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter"
aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
@@ -220,7 +220,7 @@
<i class="fa fa-angle-left"></i>
</a>
- <a rel="next prefetch" href="CONTRIBUTING.html"
class="nav-chapters next" title="Next chapter" aria-label="Next chapter"
aria-keyshortcuts="Right">
+ <a rel="next prefetch" href="api.html" class="nav-chapters
next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
diff --git a/index.html b/index.html
index 9f077f5..24ca7f8 100644
--- a/index.html
+++ b/index.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html" class="active">Introduction</a></li><li
class="chapter-item expanded affix "><li class="part-title">User Guide</li><li
class="chapter-item expanded "><a href="install.html">Install</a></li><li
class="chapter-item expanded "><a href="download.html">Download</a></li><li
class="chapter-item expanded affix "><li class="part-title">Developer
Guide</li><li class="chapter-item expanded "><a href=" [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html" class="active">Introduction</a></li><li
class="chapter-item expanded affix "><li class="part-title">User Guide</li><li
class="chapter-item expanded "><a href="install.html">Install</a></li><li
class="chapter-item expanded "><a href="download.html">Download</a></li><li
class="chapter-item expanded "><a href="api.html">API</a></li><li
class="chapter-item expanded affix "><li class="part-title [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/install.html b/install.html
index 57bb206..372beb9 100644
--- a/install.html
+++ b/install.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html" class="active">Install</a></li><li class="chapter-item
expanded "><a href="download.html">Download</a></li><li class="chapter-item
expanded affix "><li class="part-title">Developer Guide</li><li
class="chapter-item expanded "><a href=" [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html" class="active">Install</a></li><li class="chapter-item
expanded "><a href="download.html">Download</a></li><li class="chapter-item
expanded "><a href="api.html">API</a></li><li class="chapter-item expanded
affix "><li class="part-title [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/introduction.html b/introduction.html
index 9f077f5..24ca7f8 100644
--- a/introduction.html
+++ b/introduction.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html" class="active">Introduction</a></li><li
class="chapter-item expanded affix "><li class="part-title">User Guide</li><li
class="chapter-item expanded "><a href="install.html">Install</a></li><li
class="chapter-item expanded "><a href="download.html">Download</a></li><li
class="chapter-item expanded affix "><li class="part-title">Developer
Guide</li><li class="chapter-item expanded "><a href=" [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html" class="active">Introduction</a></li><li
class="chapter-item expanded affix "><li class="part-title">User Guide</li><li
class="chapter-item expanded "><a href="install.html">Install</a></li><li
class="chapter-item expanded "><a href="download.html">Download</a></li><li
class="chapter-item expanded "><a href="api.html">API</a></li><li
class="chapter-item expanded affix "><li class="part-title [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/print.html b/print.html
index b0df82c..df51b25 100644
--- a/print.html
+++ b/print.html
@@ -89,7 +89,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded affix
"><li class="part-title">Developer Guide</li><li class="chapter-item expanded
"><a href="CONTRIBUTING.ht [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded "><a
href="api.html">API</a></li><li class="chapter-item expanded affix "><li
class="part-title">Developer Gui [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
@@ -258,6 +258,307 @@
~ specific language governing permissions and limitations
~ under the License.
-->
+<h1 id="catalog"><a class="header" href="#catalog">Catalog</a></h1>
+<p><code>Catalog</code> is the entry point for accessing iceberg tables. You
can use a catalog to:</p>
+<ul>
+<li>Create and list namespaces.</li>
+<li>Create, load, and drop tables</li>
+</ul>
+<p>Currently only rest catalog has been implemented, and other catalogs are
under active development. Here is an
+example of how to create a <code>RestCatalog</code>:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span> // Create catalog
+ let config = RestCatalogConfig::builder()
+ .uri("http://localhost:8080".to_string())
+ .build();
+
+ let catalog = RestCatalog::new(config).await.unwrap();
+<span class="boring">
+</span><span class="boring"> // List all namespaces
+</span><span class="boring"> let all_namespaces =
catalog.list_namespaces(None).await.unwrap();
+</span><span class="boring"> println!("Namespaces in current catalog:
{:?}", all_namespaces);
+</span><span class="boring">
+</span><span class="boring"> let namespace_id =
+</span><span class="boring">
NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+</span><span class="boring"> // Create namespace
+</span><span class="boring"> let ns = catalog
+</span><span class="boring"> .create_namespace(
+</span><span class="boring"> &namespace_id,
+</span><span class="boring">
HashMap::from([("key1".to_string(), "value1".to_string())]),
+</span><span class="boring"> )
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Namespace created: {:?}",
ns);
+</span><span class="boring">}</span></code></pre>
+<p>You can run following code to list all root namespaces:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span> // List all namespaces
+ let all_namespaces = catalog.list_namespaces(None).await.unwrap();
+ println!("Namespaces in current catalog: {:?}", all_namespaces);
+<span class="boring">
+</span><span class="boring"> let namespace_id =
+</span><span class="boring">
NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+</span><span class="boring"> // Create namespace
+</span><span class="boring"> let ns = catalog
+</span><span class="boring"> .create_namespace(
+</span><span class="boring"> &namespace_id,
+</span><span class="boring">
HashMap::from([("key1".to_string(), "value1".to_string())]),
+</span><span class="boring"> )
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Namespace created: {:?}",
ns);
+</span><span class="boring">}</span></code></pre>
+<p>Then you can run following code to create namespace:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::{Catalog, NamespaceIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span><span class="boring"> // List all namespaces
+</span><span class="boring"> let all_namespaces =
catalog.list_namespaces(None).await.unwrap();
+</span><span class="boring"> println!("Namespaces in current catalog:
{:?}", all_namespaces);
+</span><span class="boring">
+</span> let namespace_id =
+ NamespaceIdent::from_vec(vec!["ns1".to_string(),
"ns11".to_string()]).unwrap();
+ // Create namespace
+ let ns = catalog
+ .create_namespace(
+ &namespace_id,
+ HashMap::from([("key1".to_string(),
"value1".to_string())]),
+ )
+ .await
+ .unwrap();
+
+ println!("Namespace created: {:?}", ns);
+<span class="boring">}</span></code></pre>
+<h1 id="table"><a class="header" href="#table">Table</a></h1>
+<p>After creating <code>Catalog</code>, we can manipulate tables through
<code>Catalog</code>.</p>
+<p>You can use following code to create a table:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::spec::{NestedField, PrimitiveType,
Schema, Type};
+</span><span class="boring">use iceberg::{Catalog, TableCreation, TableIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span> let table_id = TableIdent::from_strs(["default",
"t1"]).unwrap();
+
+ let table_schema = Schema::builder()
+ .with_fields(vec![
+ NestedField::optional(1, "foo",
Type::Primitive(PrimitiveType::String)).into(),
+ NestedField::required(2, "bar",
Type::Primitive(PrimitiveType::Int)).into(),
+ NestedField::optional(3, "baz",
Type::Primitive(PrimitiveType::Boolean)).into(),
+ ])
+ .with_schema_id(1)
+ .with_identifier_field_ids(vec![2])
+ .build()
+ .unwrap();
+
+ // Create table
+ let table_creation = TableCreation::builder()
+ .name(table_id.name.clone())
+ .schema(table_schema.clone())
+ .properties(HashMap::from([("owner".to_string(),
"testx".to_string())]))
+ .build();
+
+ let table = catalog
+ .create_table(&table_id.namespace, table_creation)
+ .await
+ .unwrap();
+
+ println!("Table created: {:?}", table.metadata());
+<span class="boring">
+</span><span class="boring"> let table2 = catalog
+</span><span class="boring">
.load_table(&TableIdent::from_strs(["default",
"t2"]).unwrap())
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring"> println!("{:?}", table2.metadata());
+</span><span class="boring">}</span></code></pre>
+<p>Also, you can load a table directly:</p>
+<pre><code class="language-rust no_run noplayground"><span class="boring">//
Licensed to the Apache Software Foundation (ASF) under one
+</span><span class="boring">// or more contributor license agreements. See
the NOTICE file
+</span><span class="boring">// distributed with this work for additional
information
+</span><span class="boring">// regarding copyright ownership. The ASF
licenses this file
+</span><span class="boring">// to you under the Apache License, Version 2.0
(the
+</span><span class="boring">// "License"); you may not use this file
except in compliance
+</span><span class="boring">// with the License. You may obtain a copy of the
License at
+</span><span class="boring">//
+</span><span class="boring">// http://www.apache.org/licenses/LICENSE-2.0
+</span><span class="boring">//
+</span><span class="boring">// Unless required by applicable law or agreed to
in writing,
+</span><span class="boring">// software distributed under the License is
distributed on an
+</span><span class="boring">// "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY
+</span><span class="boring">// KIND, either express or implied. See the
License for the
+</span><span class="boring">// specific language governing permissions and
limitations
+</span><span class="boring">// under the License.
+</span><span class="boring">
+</span><span class="boring">use iceberg::spec::{NestedField, PrimitiveType,
Schema, Type};
+</span><span class="boring">use iceberg::{Catalog, TableCreation, TableIdent};
+</span><span class="boring">use iceberg_catalog_rest::{RestCatalog,
RestCatalogConfig};
+</span><span class="boring">use std::collections::HashMap;
+</span><span class="boring">
+</span><span class="boring">#[tokio::main]
+</span><span class="boring">async fn main() {
+</span><span class="boring"> // Create catalog
+</span><span class="boring"> let config = RestCatalogConfig::builder()
+</span><span class="boring">
.uri("http://localhost:8080".to_string())
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let catalog =
RestCatalog::new(config).await.unwrap();
+</span><span class="boring">
+</span><span class="boring"> let table_id =
TableIdent::from_strs(["default", "t1"]).unwrap();
+</span><span class="boring">
+</span><span class="boring"> let table_schema = Schema::builder()
+</span><span class="boring"> .with_fields(vec![
+</span><span class="boring"> NestedField::optional(1,
"foo", Type::Primitive(PrimitiveType::String)).into(),
+</span><span class="boring"> NestedField::required(2,
"bar", Type::Primitive(PrimitiveType::Int)).into(),
+</span><span class="boring"> NestedField::optional(3,
"baz", Type::Primitive(PrimitiveType::Boolean)).into(),
+</span><span class="boring"> ])
+</span><span class="boring"> .with_schema_id(1)
+</span><span class="boring"> .with_identifier_field_ids(vec![2])
+</span><span class="boring"> .build()
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> // Create table
+</span><span class="boring"> let table_creation = TableCreation::builder()
+</span><span class="boring"> .name(table_id.name.clone())
+</span><span class="boring"> .schema(table_schema.clone())
+</span><span class="boring">
.properties(HashMap::from([("owner".to_string(),
"testx".to_string())]))
+</span><span class="boring"> .build();
+</span><span class="boring">
+</span><span class="boring"> let table = catalog
+</span><span class="boring"> .create_table(&table_id.namespace,
table_creation)
+</span><span class="boring"> .await
+</span><span class="boring"> .unwrap();
+</span><span class="boring">
+</span><span class="boring"> println!("Table created: {:?}",
table.metadata());
+</span><span class="boring">
+</span> let table2 = catalog
+ .load_table(&TableIdent::from_strs(["default",
"t2"]).unwrap())
+ .await
+ .unwrap();
+ println!("{:?}", table2.metadata());
+<span class="boring">}</span></code></pre>
+<div style="break-before: page; page-break-before: always;"></div><!--
+ ~ 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.
+-->
<h1 id="contributing"><a class="header"
href="#contributing">Contributing</a></h1>
<p>First, thank you for contributing to Iceberg Rust! The goal of this
document is to provide everything you need to start contributing to
iceberg-rust. The following TOC is sorted progressively, starting with the
basics and expanding into more specifics.</p>
<ul>
diff --git a/reference/setup_gpg.html b/reference/setup_gpg.html
index d6782bb..a40f28a 100644
--- a/reference/setup_gpg.html
+++ b/reference/setup_gpg.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="../introduction.html">Introduction</a></li><li class="chapter-item
expanded affix "><li class="part-title">User Guide</li><li class="chapter-item
expanded "><a href="../install.html">Install</a></li><li class="chapter-item
expanded "><a href="../download.html">Download</a></li><li class="chapter-item
expanded affix "><li class="part-title">Developer Guide</li><li
class="chapter-item expanded "><a href="../CON [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="../introduction.html">Introduction</a></li><li class="chapter-item
expanded affix "><li class="part-title">User Guide</li><li class="chapter-item
expanded "><a href="../install.html">Install</a></li><li class="chapter-item
expanded "><a href="../download.html">Download</a></li><li class="chapter-item
expanded "><a href="../api.html">API</a></li><li class="chapter-item expanded
affix "><li class="part-title">D [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/release.html b/release.html
index 53f2a44..21770f8 100644
--- a/release.html
+++ b/release.html
@@ -88,7 +88,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
- <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded affix
"><li class="part-title">Developer Guide</li><li class="chapter-item expanded
"><a href="CONTRIBUTING.ht [...]
+ <ol class="chapter"><li class="chapter-item expanded "><a
href="introduction.html">Introduction</a></li><li class="chapter-item expanded
affix "><li class="part-title">User Guide</li><li class="chapter-item expanded
"><a href="install.html">Install</a></li><li class="chapter-item expanded "><a
href="download.html">Download</a></li><li class="chapter-item expanded "><a
href="api.html">API</a></li><li class="chapter-item expanded affix "><li
class="part-title">Developer Gui [...]
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
diff --git a/searchindex.js b/searchindex.js
index 8ea6b2a..e124bd2 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search,
{"doc_urls":["introduction.html#iceberg-rust","install.html#install","download.html","CONTRIBUTING.html#contributing","CONTRIBUTING.html#your-first-contribution","CONTRIBUTING.html#workflow","CONTRIBUTING.html#git-branches","CONTRIBUTING.html#github-pull-requests","CONTRIBUTING.html#ci","CONTRIBUTING.html#setup","CONTRIBUTING.html#using-a-dev-container-environment","CONTRIBUTING.html#bring-your-own-toolbox","CONTRIBUTING.html#build","CONTRIBUTING.html#code-of
[...]
\ No newline at end of file
+Object.assign(window.search,
{"doc_urls":["introduction.html#iceberg-rust","install.html#install","download.html","api.html#catalog","api.html#table","CONTRIBUTING.html#contributing","CONTRIBUTING.html#your-first-contribution","CONTRIBUTING.html#workflow","CONTRIBUTING.html#git-branches","CONTRIBUTING.html#github-pull-requests","CONTRIBUTING.html#ci","CONTRIBUTING.html#setup","CONTRIBUTING.html#using-a-dev-container-environment","CONTRIBUTING.html#bring-your-own-toolbox","CONTRIBUTING.ht
[...]
\ No newline at end of file
diff --git a/searchindex.json b/searchindex.json
index 3804b55..c60042d 100644
--- a/searchindex.json
+++ b/searchindex.json
@@ -1 +1 @@
-{"doc_urls":["introduction.html#iceberg-rust","install.html#install","download.html","CONTRIBUTING.html#contributing","CONTRIBUTING.html#your-first-contribution","CONTRIBUTING.html#workflow","CONTRIBUTING.html#git-branches","CONTRIBUTING.html#github-pull-requests","CONTRIBUTING.html#ci","CONTRIBUTING.html#setup","CONTRIBUTING.html#using-a-dev-container-environment","CONTRIBUTING.html#bring-your-own-toolbox","CONTRIBUTING.html#build","CONTRIBUTING.html#code-of-conduct","release.html#intro
[...]
\ No newline at end of file
+{"doc_urls":["introduction.html#iceberg-rust","install.html#install","download.html","api.html#catalog","api.html#table","CONTRIBUTING.html#contributing","CONTRIBUTING.html#your-first-contribution","CONTRIBUTING.html#workflow","CONTRIBUTING.html#git-branches","CONTRIBUTING.html#github-pull-requests","CONTRIBUTING.html#ci","CONTRIBUTING.html#setup","CONTRIBUTING.html#using-a-dev-container-environment","CONTRIBUTING.html#bring-your-own-toolbox","CONTRIBUTING.html#build","CONTRIBUTING.html#
[...]
\ No newline at end of file