You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In readme VARBYTE is stated as supported as Python's bytes type. When trying to query data VARBYTE data from Redshift, 'utf-8' decoding error is thrown.
Reproduction
importredshift_connectorDROP_DDL="drop table if exists varbyte_repro"CREATE_DDL="""create table varbyte_repro( my_var varbyte);"""INSERT_DML="insert into varbyte_repro(my_var) values (from_hex(SHA1('hello')))"QUERY="select * from varbyte_repro"withredshift_connector.connect(
host="replaced",
database="replaced",
user="replaced",
password="replaced",
) asconn, conn.cursor() ascursor:
conn.autocommit=Truecursor.execute(DROP_DDL)
cursor.execute(CREATE_DDL)
cursor.execute(INSERT_DML)
cursor.execute(QUERY)
Expected
Last cursor.execute runs without issue (so that later something like cursor.fetchall could be used)
Actual
Error thrown:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xaa in position 0: invalid start byte
Activity