如何使用镶木地板文件源重命名AWS Athena列? [英] How to rename AWS Athena columns with parquet file source?

查看:50
本文介绍了如何使用镶木地板文件源重命名AWS Athena列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将数据作为多个镶木文件加载到我的S3存储桶文件夹中.将它们加载到Athena后,我可以成功查询数据.

I have data loaded in my S3 bucket folder as multiple parquet files. After loading them into Athena I can query the data successfully.

有哪些方法可以重命名实木复合地板文件源的Athena表列,并且在查询后仍然能够看到重命名列下的数据?

注意:选中编辑模式"选项后,该列将被重命名,但查询后将看不到该列下的数据.

Note: checked with edit schema option, column is getting renamed but after querying you will not see data under that column.

推荐答案

据我所知,没有一种方法可以为这些列创建名称与在文件中称为不同名称的表.该表可以具有更少或更多的列,但是只有与文件中相同的名称才是可查询的.

There is as far as I know no way to create a table with different names for the columns than what they are called in the files. The table can have fewer or extra columns, but only the names that are the same as in the files will be queryable.

但是,您可以使用其他名称创建视图,例如:

You can, however, create a view with other names, for example:

CREATE OR REPLACE VIEW a_view AS
SELECT
  a AS b,
  b AS c
FROM the_table

这篇关于如何使用镶木地板文件源重命名AWS Athena列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆