rasterframes
rasterframes copied to clipboard
Pure sql read tif, df schema error and can not read data
When I read the tif file using pure sql, the shema of the dataframe prints wrong and cannot read the data.
val readSql =
s"""
|CREATE OR REPLACE TEMPORARY VIEW my_raster
|USING raster
|OPTIONS (
|paths='LC08_L2SP_126033_20220408_20220412_02_T1_SR_B2.TIF',
|catalog_col_names='red',
|tile_dimensions='256,256'
|)
|""".stripMargin
val source = spark.sql(readSql)
source.printSchema()
source.show(10, false)
[21:18:47:214] [INFO] - org.apache.spark.internal.Logging.logInfo(Logging.scala:57) - Code generated in 10.562087 ms
root
++
||
++
++
[21:18:47:877] [INFO] - org.apache.spark.internal.Logging.logInfo(Logging.scala:57) - Invoking stop() from shutdown hook