Can I use the 'WITH' clause in Athena UNLOAD

0

I'm trying to run an UNLOAD query that starts with several 'WITH' clauses in Athena, but no matter what I try I keep getting syntax errors, has anyone have been able to run the UNLOAD operation with this kind of queries? (links and/or examples are welcome)

Thanks!

질문됨 2년 전413회 조회
1개 답변
-1

Hello,

The below Athena UNLOAD query with the WITH clause worked fine for me.

UNLOAD(select * from table)
to 's3://bucket/'
with(format='parquet',compression='snappy')

You can find some examples here

AWS
지원 엔지니어
답변함 2년 전
  • Thanks for your answer, but I mean the "classic" SQL WITH clause (for aliasing whole queries), not the with clause for adding the UNLOAD options.

    Something like:

    WITH table1 as (SELECT raw.field1, raw.field2, raw2.field1, raw2.field1 from raw, raw2 ....), table2 as (SELECT raw3.field1, raw3.field2, raw3.field3 from raw3) UNLOAD (SELECT * from table1, table2 ....) to 's3://bucket/' with(format='parquet',compression='snappy')

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠