stackql / stackql

Query, provision and operate Cloud and SaaS resources and APIs using an extensible SQL based framework
https://stackql.io/
MIT License
464 stars 44 forks source link

[BUG] Can't query 2 AWS provider resources with INNER JOIN #404

Open jonochang opened 2 months ago

jonochang commented 2 months ago

Describe the bug When making a query using INNER JOIN:

❯ stackql exec "SELECT alarms.region, alarm.alarm_name FROM awscc.cloudwatch.alarms AS alarms INNER JOIN awscc.cloudwatch.alarm AS alarm ON (alarms.alarm_name = alarm.alarm_name) WHERE alarms.region = 'ap-southeast-2'";

we get the following error:

alias 'alarms' does not map to any table expression

When amending the query like so:

❯ stackql exec "SELECT region, alarm_name FROM awscc.cloudwatch.alarms AS alarms INNER JOIN awscc.cloudwatch.alarm AS alarm ON (alarms.alarm_name = alarm.alarm_name) WHERE region = 'ap-southeast-2'";

we also get a different error:

unknown key ResourceDescription

To Reproduce Steps to reproduce the behavior:

Expected behavior

Screenshots N/A

Desktop (please complete the following information): OS: MacOSX CLI

Smartphone (please complete the following information): N/A

Additional context N/A

general-kroll-4-life commented 2 months ago

Cheers @jonochang good catch. Shall get to work on this and update when possible.

Thanks Again