AWS CTAS:如何双引号值?

AWS CTAS: How to double quote values?

在 AWS Athena 中,我如何指定将值用双引号 "value"。我设法使用 field_delimiter 表达式指定分隔符。

假设你有 table cust_transaction 两列 id,amount 其中 amount 是 int 数据类型,你可以 CTAS 如下。该方法非常手动,如果列数很大,可能会很麻烦。您还需要将非字符串数据类型显式转换为 varchar。希望有所帮助。是您要找的吗?

create table cust_transaction_pipe_1
with (external_location = 's3://aws_bucket/cust_tx_pipe_1/',format='TEXTFILE',field_delimiter = '|')
as 
select concat(chr(34), id ,chr(34)) as id,concat(chr(34) , cast(amount as varchar) ,chr(34)) as amount from cust_transaction