<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pushdown in Postgres in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67141#M33291</link>
    <description>&lt;P&gt;Thanks for response. I cannot do that as we incrementally loading from source very frequently. We cannot read full data each time.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 04:14:19 GMT</pubDate>
    <dc:creator>MikeGo</dc:creator>
    <dc:date>2024-04-24T04:14:19Z</dc:date>
    <item>
      <title>Pushdown in Postgres</title>
      <link>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67126#M33287</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;In Databricks I need to query a postgres source like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;select * from postgres_tbl where id in (select id from df)&lt;/LI-CODE&gt;&lt;P&gt;the df is got from a hive table. If I use JDBC driver, and do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;query = '(select * from postgres_tbl) as t'
src_df = spark.read.format("postgresql").option("dbtable", query)....&lt;/LI-CODE&gt;&lt;P&gt;if I join src_df with df, seems no pushdown to postgres query.&amp;nbsp;&lt;BR /&gt;I know I can filter or get a sql string by convert df to id string list, but if df has many rows, the query is going to be very long. Is there a good way to make it pushdown or do federated query efficiently?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 22:23:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67126#M33287</guid>
      <dc:creator>MikeGo</dc:creator>
      <dc:date>2024-04-23T22:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pushdown in Postgres</title>
      <link>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67134#M33289</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/100643"&gt;@MikeGo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of passing the query you can read the postgres table and after that you can filter the dataframe with respective column this also use pushdown filter.&lt;/P&gt;&lt;P&gt;Ex -&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;remote_table = (spark.read
  .format("postgresql")
  .option("dbtable", "schema_name.table_name") # if schema_name not provided, default to "public".
  .option("host", "database_hostname")
  .option("port", "5432") # Optional - will use default port 5432 if not specified.
  .option("database", "database_name")
  .option("user", "username")
  .option("password", "password")
  .load()
).filter(col("id").isin(list)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Apr 2024 02:42:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67134#M33289</guid>
      <dc:creator>Ajay-Pandey</dc:creator>
      <dc:date>2024-04-24T02:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pushdown in Postgres</title>
      <link>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67141#M33291</link>
      <description>&lt;P&gt;Thanks for response. I cannot do that as we incrementally loading from source very frequently. We cannot read full data each time.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 04:14:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/pushdown-in-postgres/m-p/67141#M33291</guid>
      <dc:creator>MikeGo</dc:creator>
      <dc:date>2024-04-24T04:14:19Z</dc:date>
    </item>
  </channel>
</rss>

