Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-3704

Fix error message when violating key constraint in Kudu insert

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.6.0
    • Impala 2.8.0
    • Backend

    Description

      When inserting rows in Kudu using Impala, an unfriendly error message is reported from Impala when a unique key constraint is violated. We need to improve this.

      impala-shell> insert into t1 values (1,1);
      WARNINGS: Error while flushing Kudu session:
      Already present: entry already present in memrowset
      
      
      Error while flushing Kudu session:
      Already present: entry already present in memrowset
      

      Another issue is during insert select statements when some inserted rows violate the unique key constraints:

      impala-shell> create table t1 (a int, b int) ... <--- kudu table
      impala-shell> insert into t1 values(1,1);
      impala-shell> insert into t1 select cast(a + 100 as int), b from t1; <-- works well
      impala-shell> insert into t1 select cast(a + 100 as int), b from t1;
      

      The last statement reports an error, indicating that the insert failed. However, if we run a select on t1 we can see that some rows were successfully inserted. We should improve the error message and always report the number of inserted rows.

      Attachments

        Activity

          People

            mjacobs Matthew Jacobs
            dtsirogiannis Dimitris Tsirogiannis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: