geometry column encoded in EWKB format.
Steps
Step 1: Create a external table for your data
We define geometry column asBINARY since it is a binary column in the parquet file. We’ll change it in-place to a geometry column after migrating it to Havasu.
The
LOCATION clause specifies the path to the parquet files. Specify the path to a single file or a directory containing multiple files (globs are not permitted).Step 2: Migrate the table
org_catalog.test_db.open_building_aswan. The Havasu table was created using the original parquet files as data files.
- Python
- Scala
- Java
geometry field is still a binary field. We’ll convert it to a geometry field in the next step.
Step 3: Set geometry fields
We can set the field storing geometry as a geometry field. This won’t rewrite the data files and will only affect how Havasu interpret configured fields.- Python
- Scala
- Java
Step 4: (OPTIONAL) Create spatial index
We can runCREATE SPATIAL INDEX FOR statement to reorder the rows by spatial proximity to achieve better performance. We can optionally set a target file size for better query performance. Usually hundreds of megabytes per file is a good choice.

