I understand that I can load an entire table from a JDBC Cataloged connection via the Glue context like so:
glueContext.create_dynamic_frame.from_catalog(
database="jdbc_rds_postgresql",
table_name="public_foo_table",
transformation_ctx="datasource0"
)
However, what I'd like to do is partially load a table using the cataloged connection as if I were using an uncataloged JDBC connection via the spark session like this:
query = "(select * from public.foo_table where date='%s') as data" % date_fm)
spark.read.jdbc(url=DB_URL, table=query)
Is there a way I could use the Cataloged connection instead?
Alternatively, when using an uncataloged connection I'm having a hard time understanding how to lock down access to the uncataloged connection such that only a Glue job can access it. What are my options?