Skip to content

Commit 0f921d6

Browse files
committed
chore: rename feature name from geo to postgis
1 parent 7c60870 commit 0f921d6

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

arrow-pg/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ readme = "../README.md"
1313
rust-version.workspace = true
1414

1515
[features]
16-
default = ["arrow", "geo"]
16+
default = ["arrow", "postgis"]
1717
arrow = ["dep:arrow"]
1818
datafusion = ["dep:datafusion"]
19-
geo = ["postgres-types/with-geo-types-0_7", "dep:geoarrow", "dep:geoarrow-schema", "dep:postgis", "dep:geo-postgis", "pgwire/pg-type-postgis", "dep:geo-traits"]
19+
postgis = ["postgres-types/with-geo-types-0_7", "dep:geoarrow", "dep:geoarrow-schema", "dep:postgis", "dep:geo-postgis", "pgwire/pg-type-postgis", "dep:geo-traits"]
2020

2121
[dependencies]
2222
arrow = { workspace = true, optional = true }

arrow-pg/src/datatypes.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::sync::Arc;
22

33
#[cfg(not(feature = "datafusion"))]
44
use arrow::{datatypes::*, record_batch::RecordBatch};
5-
#[cfg(feature = "geo")]
5+
#[cfg(feature = "postgis")]
66
use arrow_schema::extension::ExtensionType;
77
#[cfg(feature = "datafusion")]
88
use datafusion::arrow::{datatypes::*, record_batch::RecordBatch};
@@ -124,8 +124,11 @@ pub fn field_into_pg_type(field: &Arc<Field>) -> PgWireResult<Type> {
124124
match field.extension_type_name() {
125125
// As of arrow 56, there are additional extension logical type that is
126126
// defined using field metadata, for instance, json or geo.
127-
#[cfg(feature = "geo")]
128-
Some(geoarrow_schema::PointType::NAME) => Ok(Type::POINT),
127+
//
128+
// TODO: there is no fixed Geometry/Geography type id, here we use text
129+
// for placeholder.
130+
#[cfg(feature = "postgis")]
131+
Some(geoarrow_schema::PointType::NAME) => Ok(Type::TEXT),
129132

130133
_ => into_pg_type(arrow_type),
131134
}

arrow-pg/src/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rust_decimal::Decimal;
2020
use timezone::Tz;
2121

2222
use crate::error::ToSqlError;
23-
#[cfg(feature = "geo")]
23+
#[cfg(feature = "postgis")]
2424
use crate::geo_encoder::encode_geo;
2525
use crate::list_encoder::encode_list;
2626
use crate::struct_encoder::encode_struct;
@@ -292,7 +292,7 @@ pub fn encode_value<T: Encoder>(
292292
) -> PgWireResult<()> {
293293
let arrow_type = arrow_field.data_type();
294294

295-
#[cfg(feature = "geo")]
295+
#[cfg(feature = "postgis")]
296296
if let Some(geoarrow_type) = geoarrow_schema::GeoArrowType::from_extension_field(arrow_field)
297297
.map_err(|e| PgWireError::ApiError(Box::new(e)))?
298298
{

arrow-pg/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
pub mod datatypes;
77
pub mod encoder;
88
mod error;
9-
#[cfg(feature = "geo")]
9+
#[cfg(feature = "postgis")]
1010
pub mod geo_encoder;
1111
pub mod list_encoder;
1212
pub mod row_encoder;

datafusion-postgres/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ env_logger = "0.11"
3737

3838
[features]
3939
default = []
40-
postgis = ["geodatafusion", "arrow-pg/geo"]
40+
postgis = ["geodatafusion", "arrow-pg/postgis"]

0 commit comments

Comments
 (0)