) Invalid operation: plan should not reference subplan's variable

Hi! does anybody know what happen to my code? I was using sql in quicksight to prepare data, then happened this:

Error details

region: eu-west-1
timestamp: 1673292426845
requestId: 971acbe3-c266-4bae-8c09-ec54258c99ca
sourceErrorCode: 500310
sourceErrorMessage: Amazon Invalid operation: plan should not reference subplan’s variable;
sourceErrorState: XX000
sourceException: java.sql.SQLException
sourceType: REDSHIFT

Hi @ztao39

The issue appears to be with the custom SQL query being used. Can you run the query against your Redshift cluster using any IDE or Redshift query editor and check if the error persists? If so, the query has to be modified.

Please let us know if the query works without any issues in your IDE/query editor.


it worked in redshift but not in quicksight

I’m marking this as an error and hopefully can get someone to look at it.

Thank you for letting us know. I would recommend filing a case with AWS Support where we can dive into the details so that we can help you further. Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!