Search code examples
amazon-web-servicesamazon-redshiftamazon-quicksightamazon-redshift-spectrum

AWS Quicksight, Redshift "A subquery that refers to a nested table cannot contain WINDOW operation"


The error message is:

sourceErrorCode:    
500310
sourceErrorMessage:     
[Amazon](500310) Invalid operation: Spectrum nested query error Details: 
----------------------------------------------- 
error: Spectrum nested query error code: 8001 context: A subquery that 
refers to a nested table cannot contain WINDOW operation. 
query: 0 
location: nested_query_rewriter.cpp:756 
process: padbmaster 

And this happens when I add data from Redshift Spectrum into Quicksight and try to create some visualizations. I understand that Redshift Spectrum has some nested data limitations but I am not writing the queries myself (since I'm using Quicksight).

Is there anything I can do for this? I can use Athena with the same data and it works fine.

The custom SQL Expression I use on Quicksight is:

select
d.metadata.x as x,
d.metadata.y as y,
d.metadata.z as z,
d.metadata.w as w,
d.metadata.a as a,
r.timestamp.seconds as ts_seconds,
r.timestamp.microseconds as ts_microseconds,
r.b as b
from s3.data as d, d.results r

(obviously mock fields)


Solution

  • In the end, to make everything easier, I flattened the data