<?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: Optimal Batch Size for Batch Insert Queries using JDBC for Delta Tables in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/optimal-batch-size-for-batch-insert-queries-using-jdbc-for-delta/m-p/20582#M13905</link>
    <description>&lt;P&gt;Just an observation : By using auto optimize table level property, I was able to see batch inserts inserting records in single file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/optimizations/auto-optimize.html" alt="https://docs.databricks.com/optimizations/auto-optimize.html" target="_blank"&gt;https://docs.databricks.com/optimizations/auto-optimize.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 09:47:18 GMT</pubDate>
    <dc:creator>ridrasura</dc:creator>
    <dc:date>2022-12-06T09:47:18Z</dc:date>
    <item>
      <title>Optimal Batch Size for Batch Insert Queries using JDBC for Delta Tables</title>
      <link>https://community.databricks.com/t5/data-engineering/optimal-batch-size-for-batch-insert-queries-using-jdbc-for-delta/m-p/20581#M13904</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am currently experimenting with databricks-jdbc : 2.6.29 and trying to execute batch insert queries &lt;/P&gt;&lt;P&gt;What is the optimal batch size recommended by Databricks for performing Batch Insert queries?&lt;/P&gt;&lt;P&gt;Currently it seems that values are inserted row by row even if Batch Insert is done.&lt;/P&gt;&lt;P&gt;Is there any recommended way to perform multi-row insert?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Note&lt;/B&gt; : using commons-dbutils as a wrapper on JDBC.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;public static void insertRecordsBatchDbUtils() {
        String dbUrl = "jdbc:databricks://#####################";
        DataSource d = new DataSource();
        d.setURL(dbUrl);
        d.setUserID("token");
        d.setPassword("##############################");
        QueryRunner queryRunner = new QueryRunner();
        try (Connection con = d.getConnection()) {
            String sql = "INSERT INTO events.segment_debuggability_test VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
&amp;nbsp;
            int[] result = queryRunner.batch(con, sql, new Object[][]{
                    {"130", "bolt_regular_customer", "advertiser public", "DELETE", "3455642", "bolt", "org3","org","file_34","azure_blob_path_1","M-Particle","success","10/10/2022 20:00","compliance success","1"},
                    {"132", "swiggy_customer", "advertiser private", "ADD", "3455634", "swiggy", "org5","org","file_209","s3_path_134","Private Segment","success","25/10/2022 20:00","compliance success","1"},
                    {"122", "zomato_customer", "advertiser public", "ADD", "34556445", "zomato", "org45","org","file_090","s3_path_161","S3 Segment Upload","failure","13/10/2022 20:00","compliance failure : advertiser-non-compliant","1"}});
&amp;nbsp;
            System.out.println("Inserted Records :: " + result.length);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 12:32:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/optimal-batch-size-for-batch-insert-queries-using-jdbc-for-delta/m-p/20581#M13904</guid>
      <dc:creator>ridrasura</dc:creator>
      <dc:date>2022-11-25T12:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Optimal Batch Size for Batch Insert Queries using JDBC for Delta Tables</title>
      <link>https://community.databricks.com/t5/data-engineering/optimal-batch-size-for-batch-insert-queries-using-jdbc-for-delta/m-p/20582#M13905</link>
      <description>&lt;P&gt;Just an observation : By using auto optimize table level property, I was able to see batch inserts inserting records in single file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/optimizations/auto-optimize.html" alt="https://docs.databricks.com/optimizations/auto-optimize.html" target="_blank"&gt;https://docs.databricks.com/optimizations/auto-optimize.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 09:47:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/optimal-batch-size-for-batch-insert-queries-using-jdbc-for-delta/m-p/20582#M13905</guid>
      <dc:creator>ridrasura</dc:creator>
      <dc:date>2022-12-06T09:47:18Z</dc:date>
    </item>
  </channel>
</rss>

