Amazon Redshift는 2026년 6월 30일 이후에 Python UDF 사용을 더 이상 지원하지 않습니다. 해당 조치는 단계적으로 시행될 예정입니다. Python 수명 종료 및 마이그레이션 옵션에 대한 자세한 내용은 2025년 6월 30일에 게시된 블로그 게시물
pandas와 Python 커넥터 통합
다음은 Python 커넥터를 pandas와 통합하는 예입니다.
>>> import pandas #Connect to the cluster >>> import redshift_connector >>> conn = redshift_connector.connect( host='examplecluster.abc123xyz789.us-west-1.redshift.amazonaws.com', port=5439, database='dev', user='awsuser', password='my_password' ) # Create a Cursor object >>> cursor = conn.cursor() # Query and receive result set cursor.execute("select * from book") result: pandas.DataFrame = cursor.fetch_dataframe() print(result)