amazon-web-servicesamazon-redshiftcross-databasefederated-queries

Is it feasible to perform a cross database federated query in redshift?


while cross database queries (in ra3 node based clusters) and federated queries individually seem to work, together it seems that they won't work. I am most probably missing something, hence the question. Below are the details:

select count(1) from ext_mdb.Table2;

select count(1) from RSDB1.ext_mdb.Table2; # this also works

select count(1) from RSDB1.ext_mdb.Table2; # this doesn't from RSDB2

ERROR: Relation Table2 does not exist in the database.


Solution

  • It seems like a limitation for cross database queries in redshift at the moment from what I understood reading this : https://docs.aws.amazon.com/redshift/latest/dg/cross-database_limitation.html

    where it says

    Amazon Redshift doesn't support query catalog objects on AWS Glue or federated databases. To query these objects, first create external schemas that refer to those external data sources in each database.