<?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: How to process a large delta table with UDF ? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-process-a-large-delta-table-with-udf/m-p/24769#M17242</link>
    <description>&lt;P&gt;That udf code will run on driver so better not use it for such a big dataset. What you need is vectorized pandas udf &lt;A href="https://docs.databricks.com/spark/latest/spark-sql/udf-python-pandas.html" target="test_blank"&gt;https://docs.databricks.com/spark/latest/spark-sql/udf-python-pandas.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 15:52:10 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-03-24T15:52:10Z</dc:date>
    <item>
      <title>How to process a large delta table with UDF ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-process-a-large-delta-table-with-udf/m-p/24768#M17241</link>
      <description>&lt;P&gt;I have a delta table with about 300 billion rows. Now I am performing some operations on a column using UDF and creating another column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is something like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;def my_udf(data):
    return pass
       
&amp;nbsp;
udf_func = udf(my_udf, StringType())
data = spark.sql("""SELECT * FROM large_table """)
data = data.withColumn('new_column', udf_func(data.value))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The issue now is this take a long amount of time as Spark will process all 300 billion rows and then write the output. Is there a way where we can do some Mirco batching and write output of those regularly to the output delta table&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 15:39:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-process-a-large-delta-table-with-udf/m-p/24768#M17241</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2022-03-24T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to process a large delta table with UDF ?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-process-a-large-delta-table-with-udf/m-p/24769#M17242</link>
      <description>&lt;P&gt;That udf code will run on driver so better not use it for such a big dataset. What you need is vectorized pandas udf &lt;A href="https://docs.databricks.com/spark/latest/spark-sql/udf-python-pandas.html" target="test_blank"&gt;https://docs.databricks.com/spark/latest/spark-sql/udf-python-pandas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 15:52:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-process-a-large-delta-table-with-udf/m-p/24769#M17242</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-03-24T15:52:10Z</dc:date>
    </item>
  </channel>
</rss>

