Support Questions

Find answers, ask questions, and share your expertise

ESRI Spatial Framework does not provide a native geometry type in Hive, the alternative is to store the geometry in text or json format. What is better for functionality and performance

avatar

ESRI Spatial Framework does not provide a native geometry type in Hive, the alternative is to store the geometry in text or json format. What is better for functionality and performance.

1 ACCEPTED SOLUTION

avatar
Super Guru

@Mahipal Ramidi

Taking in account how ST_GeomFromText or St_GeomFromJson functions are used to convert text or json to geometry and then geometry is used in various functions, they provide the same functionality. If the value as text or json had to be parsed with some special conditions, then JSON would have been a better choice for processing, but that is not a known use case. As such, overall, used as explained above, text makes more sense, taking even less space (no structure included). If there will be a case where the above assumption is not true, add another column to your table, shape_json and convert text to json, or apply a text to json function for the specific scenario if performance is not impacted. If performance is impacted, denormalize by adding shape_json column.

View solution in original post

1 REPLY 1

avatar
Super Guru

@Mahipal Ramidi

Taking in account how ST_GeomFromText or St_GeomFromJson functions are used to convert text or json to geometry and then geometry is used in various functions, they provide the same functionality. If the value as text or json had to be parsed with some special conditions, then JSON would have been a better choice for processing, but that is not a known use case. As such, overall, used as explained above, text makes more sense, taking even less space (no structure included). If there will be a case where the above assumption is not true, add another column to your table, shape_json and convert text to json, or apply a text to json function for the specific scenario if performance is not impacted. If performance is impacted, denormalize by adding shape_json column.