Athena - CTAS 文件名

Athena - CTAS file name

我使用了 Athena 的 CTAS 和 INSERT 命令以及在 external_location 创建的 Avro 文件 但是文件名很奇怪,文件扩展名也不见了。 (该文件没有任何文件扩展名。文件只有他们奇怪的文件名,如哈希码) 如何为 Athena 的文件定义文件名规则? 谢谢。

如 AWS Athena 手册第 20 页所述,..."This location in Amazon S3 comprises all of the files representing your table. For more information, see Using Folders in the Amazon Simple Storage Service Console User Guide."...

参考: https://docs.aws.amazon.com/athena/latest/ug/athena-ug.pdf

所以,不,您不能定义文件(或文件,因为可能需要多个文件才能表示一个 table)的名称。但正确的思考方式是 BUCKET/PATH 代表文件名,或输出 table.

我们可能会感到困惑,因为您正在生成 AVRO 文件,这实际上是一个文件,如 PARQUET,但请记住 Athena 也可以输出为其他格式,可能是多文件。