Unload is broken when a column contains certain characters

0

We are using the UNLOAD command to dump data to S3 in a TSV format and then read it using some other programs. Our UNLOAD command looks like the following:

UNLOAD ('SELECT column1, column2, column2 FROM some_table')
TO 's3://bucket/and/a/prefix/'
CREDENTIALS 'aws_access_key_id=<put_access_key_id_here>;aws_secret_access_key=<put_secret_access_key_here>'
ALLOWOVERWRITE
NULL AS '$$NULL$$'
ESCAPE
ADDQUOTES
DELIMITER '\t';

This works fine, but we noticed it breaks the output format when column1 contains the following string: "1% G".

Just to be clear:
column1 = "some text 1% General more text"
column2 = 10
column3 = "whatever"

We would expect to get a TSV with that looks like the following:
"some text 1% General more text"\t"10"\t"whatever"

Instead, we get:
"some text 1-NANeneral more text\t"10"\t"whatever"

Please note:

  1. The TSV we get is broken - the first column isn't enclosed in quotes.
  2. 1% G has been turned into 1-NAN.
已提問 5 年前檢視次數 523 次
1 個回答
0
已接受的答案

Sorry you've experienced this problem. I think you are currently on 1.0.6145. We identified the issue and are releasing a new version 1.0.6230 that resolves it.

You can either upgrade in the console to 1.0.6230 or later or you can rollback to the previous version temporarily. https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#rs-mgmt-cluster-version

Please contact AWS Support if you need further assistance.

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南