[
https://issues.jboss.org/browse/TEIID-3619?page=com.atlassian.jira.plugin...
]
Juraj Duráni commented on TEIID-3619:
-------------------------------------
Yes, the HBase has autoCommit to false by default. As I wrote in my first comment, the
simplest and probably the best solution is to set
"phoenix.connection.autoCommit" to true. Autocommit is set to false from some
reason and we should not change this behavior in the Teiid. Autocommit can be set to true
very easily [1].
Please, find other details below [2]. I am running the HBase in standalone mode on
localhost (see version in the "Environment"). You can use some SQL client, e.g.
squirrel, to connect to the VDB.
[1]
{code:xml}
<datasource jndi-name="java:/localHBase" pool-name="localHBase"
enabled="true">
<connection-url>jdbc:phoenix:localhost</connection-url>
<connection-property name="phoenix.connection.autoCommit">
true
</connection-property>
<driver>phoenix</driver>
</datasource>
{code}
[2]
*VDB:*
{code:xml}
<vdb name="hbase" version="1">
<model name="hbase">
<source name="local" translator-name="hbase"
connection-jndi-name="java:/localHBase" />
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY OPTIONS (nameinsource
'intkey'),
StringKey string OPTIONS (nameinsource 'stringkey')) OPTIONS
(CARDINALITY 50, UPDATABLE 'TRUE', nameinsource 'smalla');
]]>
</metadata>
</model>
</vdb>
{code}
*Phoenix table:* the table was created via Phoenix driver. The table previously did not
exist in the HBase.
{code:sql}
CREATE TABLE smalla(intkey integer primary key,stringkey varchar(10));
UPSERT INTO smalla VALUES(1, '1');
UPSERT INTO smalla VALUES(3, '3');
UPSERT INTO smalla VALUES(5, '5');
UPSERT INTO smalla VALUES(7, '7');
{code}
HBase translator - INSERT and UPDATE statements have no effect
--------------------------------------------------------------
Key: TEIID-3619
URL:
https://issues.jboss.org/browse/TEIID-3619
Project: Teiid
Issue Type: Bug
Affects Versions: 8.7.1.6_2
Environment: Hbase: 1.1.1
Phoenix: 4.5.0-HBase-1.1
Reporter: Juraj Duráni
Assignee: Kylin Soong
Teiid's INSERT and UPDATE statement have no effect [1]. Both statements are
translated as UPSERT which needs Connection.commit() to take effect [2].
[1]
*select intkey, stringkey from hbase.smalla where intkey = 5*
|intkey|stringkey|
|5|5|
*update hbase.smalla set stringkey = '1000' where intkey = 5*
no exception here
*select intkey, stringkey from hbase.smalla where intkey = 5*
|intkey|stringkey|
|5|5|
[2]
http://phoenix.apache.org/faq.html#I_want_to_get_started_Is_there_a_Phoen...
section "2. Using java"
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)