steampipe-postgres-fdw icon indicating copy to clipboard operation
steampipe-postgres-fdw copied to clipboard

join `get` calls that throw errors or have null values in joined KeyColumns cause errors

Open johnsmyth opened this issue 4 years ago • 1 comments

The plugin should probably just return no rows instead of error:

  select * from aws_iam_policy where arn = 'x'

  Error: InvalidParameter: 1 validation error(s) found.
  - minimum field size of 20, GetPolicyInput.PolicyArn.

but it seems like either the FDW of the SDK might be able to detect when the join key is null and NOT do the nested query???

select 
    u.name as user_name, 
    u.arn as user_arn,  
    u.permissions_boundary_arn, 
    p.name as policy_name,
    p.arn as policy_arn
from 
    aws_morales.aws_iam_user as u, 
    aws_morales.aws_iam_policy as p
where u.permissions_boundary_arn = p.arn

Error: InvalidParameter: 1 validation error(s) found.
- minimum field size of 20, GetPolicyInput.PolicyArn. 

Note that this is also potentially solved by NOT passing PathKeys for KeyColumns on Get and continue to do list calls and have Postgres merge them (which may be more efficient in some cases, especially with caching enabled?)

johnsmyth avatar Mar 11 '21 16:03 johnsmyth