Bug 1252340 - HBase translator - INSERT could rewrite the data
HBase translator - INSERT could rewrite the data
Status: CLOSED CURRENTRELEASE
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid, Documentation (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: CR2
: 6.2.0
Assigned To: David Le Sage
Juraj Duráni
: Documentation
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-11 04:23 EDT by Juraj Duráni
Modified: 2016-01-27 08:18 EST (History)
2 users (show)

See Also:
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-28 20:57:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3622 Major Closed HBase translator - INSERT could rewrite the data 2016-01-27 08:18 EST

  None (edit)
Description Juraj Duráni 2015-08-11 04:23:49 EDT
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 04:31:13 EDT
Kylin Soong <ksoong@redhat.com> updated the status of jira TEIID-3622 to Closed
Comment 2 JBoss JIRA Server 2015-08-12 07:02:05 EDT
Juraj Duráni <jdurani@redhat.com> updated the status of jira TEIID-3622 to Reopened
Comment 3 Van Halbert 2015-08-24 08:42:38 EDT
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 00:19:32 EDT
Info about HBase behaviour added to topic "JDBC Translator: Translator Types" in the Reference Guide.
Comment 5 JBoss JIRA Server 2015-09-02 16:27:04 EDT
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3622 to Resolved
Comment 6 JBoss JIRA Server 2016-01-27 08:18:44 EST
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3622 to Closed

Note You need to log in before you can comment on or make changes to this bug.