zhangfengcdt opened a new issue, #2419:
URL: https://github.com/apache/sedona/issues/2419
Currently, we cannot create permanent views if the view uses Sedona
expressions, for example,
```
CREATE VIEW nyc_buildings_with_functions AS
SELECT * FROM (
SELECT
nyc_buildings_geom_test.PROP_ADDR AS name,
nyc_buildings_geom_test.geom AS building_geom,
avg(elevation_zones_test.elevation) AS elevation
FROM
nyc_buildings_geom_test
JOIN
elevation_zones_test
ON
st_intersects(elevation_zones_test.zone_geom,
elevation_zones_test.zone_geom)
GROUP BY
nyc_buildings_geom_test.PROP_ADDR, nyc_buildings_geom_test.geom
)
WHERE elevation > 0
```
It fails with the following errors:
[INVALID_TEMP_OBJ_REFERENCE] Cannot create the persistent object
`spark_catalog`.`default`.`nyc_buildings_with_functions` of the type VIEW
because it references to the temporary object `st_intersects` of the type
FUNCTION. Please make the temporary object `st_intersects` persistent, or make
the persistent object `spark_catalog`.`default`.`nyc_buildings_with_functions`
temporary.
org.apache.spark.sql.AnalysisException: [INVALID_TEMP_OBJ_REFERENCE] Cannot
create the persistent object
`spark_catalog`.`default`.`nyc_buildings_with_functions` of the type VIEW
because it references to the temporary object `st_intersects` of the type
FUNCTION. Please make the temporary object `st_intersects` persistent, or make
the persistent object `spark_catalog`.`default`.`nyc_buildings_with_functions`
temporary.
at
org.apache.spark.sql.errors.QueryCompilationErrors$.notAllowedToCreatePermanentViewByReferencingTempFuncError(QueryCompilationErrors.scala:2891)
We will need to fix this so that users can create permanent (not temp) views
like this.
--
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]