Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure sql read tif, df schema error and can not read data #588

Open
imperio-wxm opened this issue Jul 5, 2022 · 0 comments
Open

Pure sql read tif, df schema error and can not read data #588

imperio-wxm opened this issue Jul 5, 2022 · 0 comments

Comments

@imperio-wxm
Copy link

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)

Print

[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant