The HBase translator translates INSERT as UPSERT, which is an "alias" for both INSERT and UPDATE statement. It means, if user issues same INSERT statement twice, no exception is thrown [1]. I expect that [2] could rewrite the data. Additional note: I was not able to verify my assumption because of https://issues.jboss.org/browse/TEIID-3619 [1] INSERT INTO smalla (intkey) VALUES (55) is translated as UPSERT INTO smalla (intkey) VALUES (55) http://phoenix.apache.org/language/index.html#upsert_values [2] INSERT INTO smalla (intkey, name) VALUES (1, 'name1') INSERT INTO smalla (intkey, name) VALUES (1, 'name2')
Kylin Soong <ksoong> updated the status of jira TEIID-3622 to Closed
Juraj Duráni <jdurani> updated the status of jira TEIID-3622 to Reopened
Need to document the HBase translator behavior: The HBase translator will rewrite the data in the following scenario: Standard behavior: Queries: CREATE TABLE TableA (id integer PRIMARY KEY, name varchar(10)); INSERT INTO TableA (id, name) VALUES (1, 'name1'); INSERT INTO TableA (id, name) VALUES (1, 'name2'); ---> this command will fail because uniqueness of the PRIMARY KEY would be corrupted Table after queries: id name 1 name1 Behavior of the HBase translator: Queries: CREATE TABLE TableA (id integer PRIMARY KEY, name varchar(10)); INSERT INTO TableA (id, name) VALUES (1, 'name1'); INSERT INTO TableA (id, name) VALUES (1, 'name2'); ---> this command will NOT fail and will rewrite the data Table after queries: id name 1 name2 The behavior is that Teiid will convert INSERT into UPSERT, for which is sent to HBase.
Info about HBase behaviour added to topic "JDBC Translator: Translator Types" in the Reference Guide.
Steven Hawkins <shawkins> updated the status of jira TEIID-3622 to Resolved
Steven Hawkins <shawkins> updated the status of jira TEIID-3622 to Closed