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

Dynamically typed ProjectedRasterTile expressions don't deserialize to Tile #295

Closed
metasim opened this issue Aug 19, 2019 · 1 comment · Fixed by #298

Comments

@metasim
Copy link
Member

commented Aug 19, 2019

If minus and one are ProjectedRasterTiles, the following code will throw a runtime cast exception.

val df = Seq((minus, one)).toDF("minus", "one")
assertEqual(df.select(rf_abs($"minus")).first(), one)

error:

cannot resolve 'CAST(`rf_abs(minus)` AS STRUCT<`cell_context`: STRUCT<`cellType`: STRUCT<`cellTypeName`: STRING>, `dimensions`: STRUCT<`cols`: SMALLINT, `rows`: SMALLINT>>, `cell_data`: STRUCT<`cells`: BINARY, `ref`: STRUCT<`source`: STRUCT<`raster_source_kryo`: BINARY>, `bandIndex`: INT, `subextent`: STRUCT<`xmin`: DOUBLE, `ymin`: DOUBLE, `xmax`: DOUBLE, `ymax`: DOUBLE>>>>)' due to data type mismatch: cannot cast struct<tile_context:struct<extent:struct<xmin:double,ymin:double,xmax:double,ymax:double>,crs:struct<crsProj4:string>>,tile:tile> to tile;

@metasim metasim added the bug label Aug 19, 2019

@metasim metasim self-assigned this Aug 19, 2019

@metasim

This comment has been minimized.

Copy link
Member Author

commented Aug 19, 2019

Taking the path of making overloaded tile methods return an untyped column since specific type. guarantee can't be made.

metasim added a commit to s22s/rasterframes that referenced this issue Aug 19, 2019
Fix for columnar functions which accept `Tile` or `ProjectedRasterTile`,
but claimed all return values were `Tile`. This was problematic whenever
the `Tile` as reified, and the serialization of `ProjectedRasterTile` confused
the `Tile` deserializer.

Fixes locationtech#295

@metasim metasim closed this in #298 Aug 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.