Python language support for UDFs - Amazon Redshift

Python language support for UDFs

You can create a custom UDF based on the Python programming language. The Python 2.7 standard library is available for use in UDFs, with the exception of the following modules:

  • ScrolledText

  • Tix

  • Tkinter

  • tk

  • turtle

  • smtpd

In addition to the Python Standard Library, the following modules are part of the Amazon Redshift implementation:

You can also import your own custom Python modules and make them available for use in UDFs by executing a CREATE LIBRARY command. For more information, see Example: Importing custom Python library modules.

Important

Amazon Redshift blocks all network access and write access to the file system through UDFs.

Note

Python 3 isn’t available for Python UDFs. To get Python 3 support for Amazon Redshift UDFs, use Scalar Lambda UDFs instead.