-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add option to ignore GeoParquet, disable spatial autoloading when reading GeoParquet #14297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
const auto is_loaded = ExtensionHelper::TryAutoLoadExtension(context, "spatial"); | ||
if (!is_loaded) { | ||
// Spatial extension is not available, we can't make use of the metadata anyway. | ||
yyjson_doc_free(geo_metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to stay in?
And possibly also the comment // Check if the spatial extension is loaded, or try to autoload it.
could be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
e51ed8a
to
2c9dcd2
Compare
…n checking if conversion is enabled as well
Thanks! |
Add option to ignore GeoParquet, disable spatial autoloading when reading GeoParquet (duckdb/duckdb#14297)
Add option to ignore GeoParquet, disable spatial autoloading when reading GeoParquet (duckdb/duckdb#14297) Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Closes duckdb/duckdb-node#124
Closes duckdb/duckdb-spatial#423
This PR changes the GeoParquet reading behavior so that the spatial extension is no longer auto-loaded when GeoParquet metadata is detected. Spatial was not marked as autoloadable and the way the load was issued did not respect auto loading settings either. If spatial would become auto-loadable in the future we can change this behavior back (but this time also respect auto loading settings).
This PR also adds a new setting to the parquet extension
enable_geoparquet_conversion = true (default)
which controls whether geometry data will be converted when reading/writing GeoParquet files (and the spatial extension is loaded). This enables you to "fall back" to reading writing parquet files normally even if they have geoparquet metadata. This is primarily useful when trying to read a geoparquet file that is incompatible with the current geoparquet support in duckdb, either because it uses an unsupported version/encoding or because it is non-standards compliant (or the metadata is broken in some other way).Additionally, I've also moved over the geoparquet tests and test files into this repository for now. Since they
require spatial
they won't be invoked during our normal CI runs (I think?), but it still useful when testing locally.