Geometry as a Primitive Type
Besides the primitive types supported by Apache Iceberg, Havasu introduced a new data typeGEOMETRY to represent geospatial data. For instance, user can create a table with a geometry column using SQL:
- Python
- Scala
- Java
id. Notice that Havasu introduced a new data type GEOMETRY to represent geospatial data. We can inspect the table schema using DESCRIBE command:
- Python
- Scala
- Java
- Python
- Scala
- Java
.printSchema() function:
- Python
- Scala
- Java
- Python
- Scala
- Java
Creating Table with Geometry Column
As mentioned above, user can create a Havasu table using SQL:- Python
- Scala
- Java
- Python
- Scala
- Java
- Python
- Scala
- Java
Writing Data
INSERT INTO
User can insert data into a Havasu table usingINSERT INTO table_name VALUES:
- Python
- Scala
- Java
INSERT INTO table_name SELECT ... to insert result set of a query into the table:
- Python
- Scala
- Java
Writing DataFrame to Havasu table
User can write a DataFrame containing geometry data to a Havasu table:- Python
- Scala
- Java
INSERT INTO table_name SELECT ... statement.
Updating data in Havasu table
Havasu supports UPDATE queries that update matching rows in tables. Update queries accept a filter to match rows to update. Spatial filters are also supported in Havasu.- Python
- Scala
- Java
Deleting data from Havasu table
Havasu supports DELETE FROM queries to remove data from tables. Delete queries accept a filter to match rows to delete. Spatial filters are also supported in Havasu.- Python
- Scala
- Java
Merging DataFrame into Havasu table using MERGE INTO
Havasu supports MERGE INTO by rewriting data files that contain rows that need to be updated in an overwrite commit.
The syntax is identical to the open source Apache Iceberg, please refer to Apache Iceberg - MERGE INTO for more information.
Querying Data
User can load data from a Havasu table usingsedona.table(...):
- Python
- Scala
- Java
- Python
- Scala
- Java
- Python
- Scala
- Java
- Python
- Scala
- Java
.format("havasu.iceberg"), this will load an isolated table reference that will not automatically refresh tables used by queries.
- Python
- Scala
- Java
Working with Geometry Data
Data in columns withgeometry type will be loaded as GeometryUDT values in Sedona, user can use any ST_ functions provided by WherobotsDB to manipulate the geospatial data. For example, user can use ST_Buffer to create a buffer around the geometry column:
- Python
- Scala
- Java
- Python
- Scala
- Java
writeTo function on the resulting DataFrame of the query:
- Python
- Scala
- Java

