question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

insert data java.sql.SQLException: Broken pipe (Write failed)

See original GitHub issue

Environment

  • OS version: mac lastest
  • JDK version: 1.8
  • ClickHouse Server version: lastest
  • ClickHouse Native JDBC version: 2.5.4
  • (Optional) Spark version: N/A 3.0.1
  • (Optional) Other components’ version: N/A

use spark insert batch data to clickhouse meet error link log https://github.com/ClickHouse/ClickHouse/issues/6503

Error logs

    try {
      //var rowCount = 0
      stmt.setQueryTimeout(options.queryTimeout)
      df.collect().foreach { row =>
        var i = 0
        while (i < numFields) {
          if (row.isNullAt(i)) {
            stmt.setNull(i + 1, nullTypes(i))
          } else {
            setters(i).apply(stmt, row, i)
          }
          i = i + 1
        }
        stmt.addBatch()
//        stmt.execute() // too slow  badly

      }
      stmt.executeBatch()
//      stmt.executeLargeBatch()

    } finally {
      stmt.close()
    }

Steps to reproduce

Other descriptions

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sundy-licommented, Jul 5, 2021

@geraldo-netto You are using ru.yandex.clickhouse, but this is the native driver.

0reactions
leachlicommented, May 8, 2022

I committed a batch of 250,000 once while migrating data

Read more comments on GitHub >

github_iconTop Results From Across the Web

oracle - java.sql.SQLException: Io exception: Broken pipe how ...
The problem in this case is that the Oracle driver is discovering that it's socket to the DBMS somehow (firewall again, maybe?) has...
Read more >
What is a Broken pipe SQLException?
The java.sql.SQLException: Io exception: Broken pipe message is due to an external interruption in the communication between the application ...
Read more >
IO Error: Broken pipe" Error when Running an ODI Scenario
Oracle Data Integrator - Version 10.1.3.5.0 and later: "java.sql.SQLException: IO Error: Broken pipe" Error when Running an ODI Scenario.
Read more >
“java.sql.SQLException: Io exception: Broken pipe” at Copy to ...
If the probe finds a terminated connection, or a connection that is no longer in use, it returns an error, causing the server...
Read more >
Broken Pipe - webMethods
The original exception message was: java.sql.SQLException: [wm-cjdbc34-0042][Oracle JDBC Driver]No more data available to read.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found