Amazon Redshift will no longer support the creation of new Python UDFs starting November 1, 2025.
If you would like to use Python UDFs, create the UDFs prior to that date.
Existing Python UDFs will continue to function as normal. For more information, see the
blog post
Considerations when using spatial data with Amazon Redshift
The following are considerations when using spatial data with Amazon Redshift:
The maximum size of a
GEOMETRYorGEOGRAPHYobject is 1,048,447 bytes.Amazon Redshift Spectrum doesn't natively support spatial data. Therefore, you can't create or alter an external table with a
GEOMETRYorGEOGRAPHYcolumn.Data types for Python user-defined functions (UDFs) don't support the
GEOMETRYorGEOGRAPHYdata type.You can't use a
GEOMETRYorGEOGRAPHYcolumn as a sort key or a distribution key for an Amazon Redshift table.You can't use
GEOMETRYorGEOGRAPHYcolumns in SQL ORDER BY, GROUP BY, or DISTINCT clauses.You can't use
GEOMETRYorGEOGRAPHYcolumns in many SQL functions.You can't perform an UNLOAD operation on
GEOMETRYorGEOGRAPHYcolumns into every format. You can UNLOADGEOMETRYorGEOGRAPHYcolumns to text or comma-separated value (CSV) files. Doing this writesGEOMETRYorGEOGRAPHYdata in hexadecimal EWKB format. If the size of the EWKB data is more than 4 MB, then a warning occurs because the data can't later be loaded into a table.The supported compression encoding of
GEOMETRYorGEOGRAPHYdata is RAW.When using JDBC or ODBC drivers, use customized type mappings. In this case, the client application must have information on which parameters of a
ResultSetobject areGEOMETRYorGEOGRAPHYobjects. TheResultSetMetadataoperation returns typeVARCHAR.To copy geographic date from a
SHAPEFILE, first ingest into aGEOMETRYcolumn, and then cast the objects toGEOGRAPHYobjects. .
The following nonspatial functions can accept an input of type GEOMETRY or GEOGRAPHY, or
columns of type GEOMETRY or GEOGRAPHY:
The aggregate function COUNT
The conditional expressions COALESCE and NVL
CASE expressions
The default encoding for
GEOMETRYandGEOGRAPHYis RAW. For more information, see Compression encodings.