取消
顯示的結果
而不是尋找
你的意思是:

最優批量大小批量插入三角洲表的查詢使用JDBC

ridrasura
新的貢獻者三世

你好,

我目前在嚐試databricks-jdbc: 2.6.29並試圖執行批量插入查詢

什麼是推薦的最優批量大小為執行批量插入查詢磚嗎?

目前看來,值由行即使批量插入的行插入。

有推薦的方式來執行多行插入嗎?

請注意:使用JDBC commons-dbutils作為包裝器。

公共靜態孔隙insertRecordsBatchDbUtils(){字符串dbUrl = " jdbc:磚:/ / # # # # # # # # # # # # # # # # # # # # #”;數據源d =新數據源();d.setURL (dbUrl);d.setUserID(“令牌”);d.setPassword (“# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #”);QueryRunner QueryRunner = new QueryRunner ();試(連接con = d.getConnection()){字符串sql = "插入事件。segment_debuggability_test值(?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; 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"}}); System.out.println("Inserted Records :: " + result.length); } catch (SQLException e) { e.printStackTrace(); } }

1回複1

ridrasura
新的貢獻者三世

隻是一個觀察:通過使用自動優化表級別的屬性,我能夠看到在單一文件批量插入插入記錄。

https://docs.m.eheci.com/optimizations/auto-optimize.html

歡迎來到磚社區:讓學習、網絡和一起慶祝

加入我們的快速增長的數據專業人員和專家的80 k +社區成員,準備發現,幫助和合作而做出有意義的聯係。

點擊在這裏注冊今天,加入!

參與令人興奮的技術討論,加入一個組與你的同事和滿足我們的成員。

Baidu
map