简体   繁体   English

如何在亚马逊 s3 查询中使用 DISTINCT

[英]how to use DISTINCT in amazon s3 query

I am trying to filter distinct id's using the amazon s3 select query.我正在尝试使用 amazon s3 select 查询来过滤不同的 ID。 I tried the below query but I am getting errors running it.我尝试了以下查询,但运行时出现错误。 Could someone help me why I am getting an error?.有人可以帮助我为什么会出错吗? Please suggest a proper query请提出适当的查询

SELECT distinct s.f0 FROM s3object s

Error错误

Unsupported SQL operation DISTINCT. Please check the service documentation for supported operations.

Amazon S3 Select does not support the DISTINCT operator. Amazon S3 Select 不支持DISTINCT运算符。

S3 Select is not a full query engine. S3 Select 不是一个完整的查询引擎。 Instead, it is a quick way to filter the contents of a file.相反,它是一种过滤文件内容的快速方法。 The S3 Select 'engine' simply progresses through each line and returns data if applicable. S3 Select“引擎”简单地遍历每一行并返回数据(如果适用)。 It is not 'smart' enough to do a DISTINCT operation.它不够“聪明”,无法执行DISTINCT操作。

If you want more SQL capabilities, consider using Amazon Athena.如果您需要更多 SQL 功能,请考虑使用 Amazon Athena。 It can run SQL queries against data stored in Amazon S3, even across multiple files.它可以针对存储在 Amazon S3 中的数据运行 SQL 次查询,甚至跨多个文件。 It supports a much larger range of SQL functions.它支持更大范围的 SQL 函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM