[GH-2652] Add RS_AsCOG SQL function for Cloud Optimized GeoTiff output#2669
Draft
jiayuasu wants to merge 4 commits intoapache:masterfrom
Draft
[GH-2652] Add RS_AsCOG SQL function for Cloud Optimized GeoTiff output#2669jiayuasu wants to merge 4 commits intoapache:masterfrom
jiayuasu wants to merge 4 commits intoapache:masterfrom
Conversation
… in Scala - Remove 6 Java asCOG() wrapper overloads from RasterOutputs.java - Rewrite RS_AsCOG as custom Expression with ImplicitCastInputTypes that builds CogOptions via builder and calls asCloudOptimizedGeoTiff directly - Update Java tests to use asCloudOptimizedGeoTiff + CogOptions.builder() directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes Add RS_AsCOG (Cloud Optimized GeoTiff) writer with necessary configs #2652What changes were proposed in this PR?
This PR adds the
RS_AsCOGSQL function that converts a raster to a Cloud Optimized GeoTIFF (COG) byte array. The underlying pure Java COG writer was already merged via #2663 (sub-issue #2662). This PR wires it up as a Spark SQL function with positional overloads:Parameters:
compression: Deflate (default), LZW, JPEG, PackBitstileSize: Tile width/height in pixels, must be a power of 2 (default 256)quality: Compression quality from 0.0 (max compression) to 1.0 (default 0.2)resampling: Overview resampling algorithm - Nearest (default), Bilinear, BicubicoverviewCount: Number of overview levels, -1 for auto (default), 0 for noneFiles changed:
common/.../raster/RasterOutputs.java- 6 positional asCOG Java overloadsspark/.../expressions/raster/RasterOutputs.scala- RS_AsCOG Spark SQL expressionspark/.../UDF/Catalog.scala- Function registrationcommon/.../raster/RasterOutputTest.java- 8 Java unit tests including round-tripspark/.../sql/rasteralgebraTest.scala- 5 Spark integration tests including round-tripdocs/api/sql/Raster-writer.md- RS_AsCOG API reference documentationdocs/tutorial/raster.md- Added COG section to raster tutorialHow was this patch tested?
Did this PR include necessary documentation updates?