paleolimbot commented on code in PR #1159:
URL: https://github.com/apache/sedona-db/pull/1159#discussion_r3898912281


##########
python/sedonadb/python/sedonadb/testing.py:
##########
@@ -375,6 +395,22 @@ def create_table_arrow(self, name, obj) -> "SedonaDB":
         self.con.create_data_frame(obj).to_view(name, overwrite=True)
         return self
 
+    def create_raster_view(self, name, path) -> "SedonaDB":
+        self.con.sql(f"SELECT RS_FromPath('{path}') AS rast").to_view(
+            name, overwrite=True
+        )
+        return self
+
+    def decode_raster_result(self, sql):
+        from sedonadb.raster_testing import decode_raster
+
+        # RS_FromPath yields an OutDb (lazy) raster, so materialize the result
+        # before reading its pixels; Sedona Spark's RS_FromGeoTiff loads 
eagerly,
+        # so this keeps the two engines comparing the same bytes.
+        loaded = f"SELECT RS_EnsureLoaded(c) AS c FROM ({sql}) AS sub(c)"
+        table = self.execute_and_collect(loaded)
+        return decode_raster(table.column(0)[0])

Review Comment:
   This seems a bit strange...don't you want the parity tests to extend to 
whether something stays an InDB raster or not?



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