cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Does Databricks support writing Geography/Geometry data into BigQuery?

109005
New Contributor III
 
1 ACCEPTED SOLUTION

Accepted Solutions

jnb2387
New Contributor III

The only method I have been able to successfully write in geography data was to have the table schema already defined with a geography column and then 'APPEND' the data to it. Anytime I would try with OVERWRITE it seemingly changed the data type to string.

View solution in original post

5 REPLIES 5

Prabakar
Esteemed Contributor III
Esteemed Contributor III

Hi @Ayushi Pandeyโ€‹ are you looking for Geomesa library support? If so please refer this notebook.

https://www.databricks.com/notebooks/geomesa-h3-notebook.html

109005
New Contributor III

No, I want to know if Databricks supports writing Geography/Geometry data back into BigQuery? When I try to write it to BQ, it shows as incorrect BYTES data.

I performed the below statement and it ran successfully in Databricks:

val wktDF = wktDFText.withColumn("bq_geography", st_geomFromWKT(col("bq_geography"))).cache

image 

But when loading this wktDF to BigQuery, data is seen like this:

image.png

109005
New Contributor III

Do let me know if this is an expected behaviour since Spark does not natively support Geography/Geometry types.

jnb2387
New Contributor III

The only method I have been able to successfully write in geography data was to have the table schema already defined with a geography column and then 'APPEND' the data to it. Anytime I would try with OVERWRITE it seemingly changed the data type to string.

109005
New Contributor III

Thanks a lot! That worked ๐Ÿ™‚