sqlamazon-web-servicesamazon-s3amazon-s3-select

Is it possible to execute nested queries in S3 Select?


I am trying to execute a query of the type: SELECT * FROM (SELECT * FROM s3object s WHERE ..)

But I get the following error: Invalid Data Source type.

So does S3 Select support nested queries or am I missing on something?


Solution

  • Amazon S3 Select doesn't support nested queries. According to the documentation, Amazon S3 Select and S3 Glacier Select support the following forms of the FROM clause:

    FROM table_name
    FROM table_name alias
    FROM table_name AS alias
    

    Where table_name is one of S3Object (for Amazon S3 Select) or ARCHIVE or OBJECT (for S3 Glacier Select) referring to the archive being queried over. Users coming from traditional relational databases can think of this as a database schema that contains multiple views over a table.