AWS雅典娜:带有非标准文件结构的S3存储桶的分区表
我是雅典娜的新手,我很难了解分区的工作原理以及它是否可以对我有用。
我以以下格式有S3中的文件: path/to/files/yyyymmddthhmmsssz_< id> .json
例如:
path/to/files/20191208T130435Z_265901.json
path/to/files/20191212T132019Z_266406.json
path/to/files/20191216T102909Z_266975.json
path/to/files/20191226T095326Z_268789.json
path/to/files/20191226T103749Z_268798.json
path/to/files/20191226T110113Z_268802.json
path/to/files/20191229T182902Z_269391.json
path/to/files/20191230T041315Z_269481.json
path/to/files/20200101T200007Z_269935.json
...
我知道这不遵循正确的蜂巢风格分区的准则,但我不是数据所有者,但是我不是数据的所有者,所以这不会改变。
我的问题是:是否有任何方法可以指定每月的分区?
我正在阅读本指南但是我不确定是否以及如何适用于我的案件。
非常感谢。
I'm very new to Athena and I'm having a little bit of hard time understanding how partitioning works and if it can work for me.
I have files in S3 in the following format:path/to/files/YYYYmmDDTHHMMSSZ_<id>.json
For example:
path/to/files/20191208T130435Z_265901.json
path/to/files/20191212T132019Z_266406.json
path/to/files/20191216T102909Z_266975.json
path/to/files/20191226T095326Z_268789.json
path/to/files/20191226T103749Z_268798.json
path/to/files/20191226T110113Z_268802.json
path/to/files/20191229T182902Z_269391.json
path/to/files/20191230T041315Z_269481.json
path/to/files/20200101T200007Z_269935.json
...
I understand that this does not follow the guidelines for correct hive-style partitioning, but I'm not the owner of the data, so this cannot change.
My question is: Is there any way to specify a monthly partition to such a structure?
I'm reading this guide but I'm not sure if and how it applies to my case.
Thanks a lot in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以预处理数据并将其重命名,以具有正确的目录结构。
对于Ex:
You can pre-process your data, and rename them, to have proper directory structure.
For ex:
因此,在更仔细地阅读文档后,我认为答案是“否”。如果我在“ yyyymmdd”之后有一个定界符(“/”),则可以通过分区投影,但是由于没有,也不会发生这种情况。
似乎没有其他方法可以解决解决方案@Alex所建议的。
So, after reading the documentation more carefully, I think the answer is "no". If I had a delimiter ("/") after "YYYYmmDD", then this would be possible by partition projection, but since there is not, this cannot happen either.
It seems there is no other way as the workaround @Alex has suggested.