Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-28345

Flink JDBC connector should check batch count before flush

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.14.5, 1.15.0
    • None
    • Connectors / JDBC
    • None

    Description

      org.apache.flink.connector.jdbc.internal.JdbcOutputFormat#flush

      //代码占位符
      @Override
      public synchronized void flush() throws IOException {
          checkFlushException();
      
          for (int i = 0; i <= executionOptions.getMaxRetries(); i++) {
              try {
                  attemptFlush();
                  batchCount = 0;
                  break; 
         ....

      When flush the batch,  we should check batchCount  is grater than 0. Other wise it would cause some problem with some drivers that do not support empty batches, like clickhouse jdbc driver. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            hackergin Feng Jin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: