Skip to content
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

datatype geometry is not supported when 'create table xxx (geom geometry)' #1414

Open
freamdx opened this issue May 16, 2024 · 4 comments
Open

Comments

@freamdx
Copy link

freamdx commented May 16, 2024

Expected behavior

image

Actual behavior

image

Steps to reproduce the problem

  1. server: copy sedona-spark-shaded-3.x_2.12-1.5.x.jar to 'spark/jars'
  2. client: connect to spark-thrift-server, eg: beeline -u jdbc:hive2://<...>:<...>
  3. client: create table test (geom geometry);

Settings

Sedona version = 1.5

Apache Spark version = 3.x

Environment = spark-thrift-server

@freamdx
Copy link
Author

freamdx commented May 16, 2024

one way (not best):
image

@freamdx freamdx changed the title datatype geometry is not supported when 'create table test (geom geometry)' datatype geometry is not supported when 'create table xxx (geom geometry)' May 16, 2024
@freamdx
Copy link
Author

freamdx commented May 16, 2024

refer: freamdx/spark@cf2b0fe

@jiayuasu
Copy link
Member

@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.

@zhangfengcdt
Copy link
Contributor

@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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants