Kimahriman commented on pull request #557:
URL: https://github.com/apache/incubator-sedona/pull/557#issuecomment-954706389


   It seems to be something with creating a temp view with SQL. If you change
   
   ```
       spark.sql(
           """
             |CREATE OR REPLACE TEMP VIEW pixels AS
             |SELECT pixel, shape FROM pointtable
             |LATERAL VIEW EXPLODE(ST_Pixelize(shape, 1000, 1000, 
ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000))) AS pixel
           """.stripMargin)
   
         // Test visualization partitioner
         val zoomLevel = 2
         val newDf = VizPartitioner(spark.table("pixels"), zoomLevel, "pixel", 
new Envelope(0, 1000, 0, 1000))
   ```
   to
   ```
       val table = spark.sql(
          """
            |SELECT pixel, shape FROM pointtable
            |LATERAL VIEW EXPLODE(ST_Pixelize(shape, 1000, 1000, 
ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000))) AS pixel
           """.stripMargin)
   
         // Test visualization partitioner
         val zoomLevel = 2
         val newDf = VizPartitioner(table, zoomLevel, "pixel", new Envelope(0, 
1000, 0, 1000))
   ````
   It works fine. And this also works:
   ```
       val table = spark.sql(
          """
            |SELECT pixel, shape FROM pointtable
            |LATERAL VIEW EXPLODE(ST_Pixelize(shape, 1000, 1000, 
ST_PolygonFromEnvelope(-126.790180,24.863836,-64.630926,50.000))) AS pixel
           """.stripMargin)
         table.createOrReplaceTempView("pixels")
   
         // Test visualization partitioner
         val zoomLevel = 2
         val newDf = VizPartitioner(spark.table("pixels"), zoomLevel, "pixel", 
new Envelope(0, 1000, 0, 1000))
   ```
   
   So I'm not sure if it's a bug with creating temp views in SQL or some new 
"feature"


-- 
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]


Reply via email to