sedona
sedona copied to clipboard
datatype geometry is not supported when 'create table xxx (geom geometry)'
Expected behavior
Actual behavior
Steps to reproduce the problem
- server: copy sedona-spark-shaded-3.x_2.12-1.5.x.jar to 'spark/jars'
- client: connect to spark-thrift-server, eg: beeline -u jdbc:hive2://<...>:<...>
- client: create table test (geom geometry);
Settings
Sedona version = 1.5
Apache Spark version = 3.x
Environment = spark-thrift-server
one way (not best):
refer: https://github.com/freamdx/spark/commit/cf2b0fe18c938744f2cfb111f6878eec8ad220cf
@freamdx Thanks. This is on our radar. This can be done via adding a custom Sedona SQL parser on top of Spark, without forking Spark code. We will add the support in 1.6.1 release.
@freamdx The issue is currently being worked on. Before the fix, I think you can use the following workaround to create the Hive table.
CREATE OR REPLACE TEMP VIEW EMPTY_VIEW AS
SELECT ST_GEOMFROMTEXT(CAST(NULL AS STRING)) AS GEOM
WHERE 1 = 0;
CREATE TABLE T_TEST AS (SELECT * FROM EMPTY_VIEW);