Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Impala 2.6.0
    • Fix Version/s: Impala 2.8.0
    • Component/s: Frontend
    • Labels:
    • Docs Text:
      Introduces a new SQL operator 'UPSERT' that behaves like an insert, except for updating rows where the inserted primary keys match an already existing row. Only applied to Kudu.
    • Target Version:

      Description

      Add UPSERT to Impala. This also includes adding/updating relevant functional tests, stress tests, and query generator tests. It may impact our statistics story too (TBD, stats work tracked by IMPALA-2830).

      This should add syntax which works like INSERT for Kudu tables, but specifying that Kudu perform an UPSERT rather than an INSERT.

      UPSERT INTO table [( column [, ...] )] VALUES ( value-expression [,...] )
      UPSERT INTO table [( column [, ...] )] SELECT select-expression
      

        Activity

        Hide
        mjacobs Matthew Jacobs added a comment -

        commit 832fb537635fb695dcc85d4e27dd3b7646a7e6ab
        Author: Thomas Tauber-Marshall <tmarshall@cloudera.com>
        Date: Thu Aug 18 09:57:13 2016 -0700

        IMPALA-3725 Support Kudu UPSERT in Impala

        This patch introduces a new query statement, UPSERT, for Kudu
        tables which operates like an INSERT and uses all of the analysis,
        planning, and execution machinery as INSERT, except that if
        there's a primary key collision instead of returning an error an
        update is performed.

        New syntax:
        [with_clause] UPSERT INTO [TABLE] table_name [(column list)]

        { query_stmt | VALUES (value [, value...]) [, (value [, (value...)]) ...] }

        where column list must contain all of the key columns in
        table_name, if specified, and table_name must be a Kudu table.

        This patch also improves the behavior of INSERTing into Kudu
        tables without specifying all of the key columns - this now
        results in an analysis exception, rather than attempting the
        INSERT and receiving an error back from Kudu.

        Change-Id: I8df5cea36b642e267f85ff6b163f3dd96b8386e9
        Reviewed-on: http://gerrit.cloudera.org:8080/4047
        Reviewed-by: Matthew Jacobs <mj@cloudera.com>
        Tested-by: Internal Jenkins

        Show
        mjacobs Matthew Jacobs added a comment - commit 832fb537635fb695dcc85d4e27dd3b7646a7e6ab Author: Thomas Tauber-Marshall <tmarshall@cloudera.com> Date: Thu Aug 18 09:57:13 2016 -0700 IMPALA-3725 Support Kudu UPSERT in Impala This patch introduces a new query statement, UPSERT, for Kudu tables which operates like an INSERT and uses all of the analysis, planning, and execution machinery as INSERT, except that if there's a primary key collision instead of returning an error an update is performed. New syntax: [with_clause] UPSERT INTO [TABLE] table_name [(column list)] { query_stmt | VALUES (value [, value...]) [, (value [, (value...)]) ...] } where column list must contain all of the key columns in table_name, if specified, and table_name must be a Kudu table. This patch also improves the behavior of INSERTing into Kudu tables without specifying all of the key columns - this now results in an analysis exception, rather than attempting the INSERT and receiving an error back from Kudu. Change-Id: I8df5cea36b642e267f85ff6b163f3dd96b8386e9 Reviewed-on: http://gerrit.cloudera.org:8080/4047 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: Internal Jenkins

          People

          • Assignee:
            twmarshall Thomas Tauber-Marshall
            Reporter:
            dtsirogiannis Dimitris Tsirogiannis
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development