Bug 1252340

Summary: HBase translator - INSERT could rewrite the data
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Juraj Duráni <jdurani>
Component: Teiid, DocumentationAssignee: David Le Sage <dlesage>
Status: CLOSED CURRENTRELEASE QA Contact: Juraj Duráni <jdurani>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: atangrin, vhalbert
Target Milestone: CR2Keywords: Documentation
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Hbase: 1.1.1 Phoenix: 4.5.0-HBase-1.1
Last Closed: 2015-09-29 00:57:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juraj Duráni 2015-08-11 08:23:49 UTC
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')

Comment 1 JBoss JIRA Server 2015-08-12 08:31:13 UTC
Kylin Soong <ksoong> updated the status of jira TEIID-3622 to Closed

Comment 2 JBoss JIRA Server 2015-08-12 11:02:05 UTC
Juraj Duráni <jdurani> updated the status of jira TEIID-3622 to Reopened

Comment 3 Van Halbert 2015-08-24 12:42:38 UTC
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.

Comment 4 David Le Sage 2015-09-02 04:19:32 UTC
Info about HBase behaviour added to topic "JDBC Translator: Translator Types" in the Reference Guide.

Comment 5 JBoss JIRA Server 2015-09-02 20:27:04 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3622 to Resolved

Comment 6 JBoss JIRA Server 2016-01-27 13:18:44 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3622 to Closed