Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2061

Java Client Not Honoring setIgnoreAllDuplicateRows When Inserting Duplicate Values

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.1, 1.5.0
    • Fix Version/s: None
    • Component/s: client
    • Labels:
      None

      Description

      Duplicate values on insert are not causing warning/error to be returned when setIgnoreAllDuplicateRows is set to false. This is silently causing data loss.

      Test case. Use the example code from https://github.com/cloudera/kudu-examples/blob/master/java/java-sample/src/main/java/org/kududb/examples/sample/Sample.java. Change line 43 to insert an constant. 3 inserts will execute but only a single row with no error is thrown. See KUDU-1563 as it seems all inserts are now ignore inserts.

      1. Sample.java
        3 kB
        Scott Black

        Issue Links

          Activity

          Hide
          jdcryans Jean-Daniel Cryans added a comment -

          Hi Scott Black, sorry for the tardy insert.

          One thing that that sample code won't check is if the returned OperationResponse has an error. Duplicate rows won't throw an exception, instead the RowError's Status#isAlreadyPresent() will return true. Maybe the API could be clearer/better documented.

          Show
          jdcryans Jean-Daniel Cryans added a comment - Hi Scott Black , sorry for the tardy insert. One thing that that sample code won't check is if the returned OperationResponse has an error. Duplicate rows won't throw an exception, instead the RowError's Status#isAlreadyPresent() will return true. Maybe the API could be clearer/better documented.
          Hide
          sblack522 Scott Black added a comment -

          Thanks for help. Using OperationResponse was able to find duplicate key values. Do agree the documentation could be better and the sample code be enhanced to show the importance of OperationResponse.

          Show
          sblack522 Scott Black added a comment - Thanks for help. Using OperationResponse was able to find duplicate key values. Do agree the documentation could be better and the sample code be enhanced to show the importance of OperationResponse.
          Hide
          sblack522 Scott Black added a comment -

          Don't has push rights to the repo so attached the sample code to check for response after performing the insert operation.

          Show
          sblack522 Scott Black added a comment - Don't has push rights to the repo so attached the sample code to check for response after performing the insert operation.

            People

            • Assignee:
              Unassigned
              Reporter:
              sblack522 Scott Black
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development