2010YOUY01 commented on PR #560: URL: https://github.com/apache/sedona-db/pull/560#issuecomment-3822216561
> Mostly I think you can avoid exposing `GeoParquetMetadata` via the options and just accept a string for that parameter. I believe `serde_json` can automatically deserialize that for you to avoid the parsing code here. > > https://github.com/apache/sedona-db/blob/3f91e2657c2473dc06357999dec9282d5e45e35a/rust/sedona-geoparquet/src/metadata.rs#L292-L293 > > Exposing a `HashMap<GeoParquetColumnMetadata>` in the options is OK, too if you feel strongly about it (probably helpful if this is being used from Rust), but for our bulit-in frontends (Python, R, SQL) a String is easier to deal with. It's a great idea to make the rust internal API easier to use for different frontend bindings, WDYT: - For the builder of Rust Struct `GeoParquetReadOptions`, it takes string for Json options to make it easier to use - Inside `GeoParquetReadOptions`, it keeps typed/parsed field for `geometry_columns`, to make the rust backend impl cleaner ```rust pub struct GeoParquetReadOptions<'a> { inner: ParquetReadOptions<'a>, table_options: Option<HashMap<String, String>>, // Keep it typed to make backend impl cleaner geometry_columns: Option<HashMap<String, GeoParquetColumnMetadata>>, } pub fn with_geometry_columns( mut self, // Json config string like "{"geo": {"encoding": "wkb"}}" geometry_columns: String, ) -> Self { let parsed = parse_geometry_columns(geometry_columns); self.geometry_columns = Some(parsed); self } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
