Bug 1252340 - HBase translator - INSERT could rewrite the data
Summary: HBase translator - INSERT could rewrite the data
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid, Documentation
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR2
: 6.2.0
Assignee: David Le Sage
QA Contact: Juraj Duráni
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-11 08:23 UTC by Juraj Duráni
Modified: 2016-01-27 13:18 UTC (History)
2 users (show)

Fixed In Version:
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
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-3622 0 Major Closed HBase translator - INSERT could rewrite the data 2016-01-27 13:18:44 UTC

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


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