[JBoss JIRA] (TEIID-3620) HBase translator - date, time, timestamp values are not translated correctly
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3620?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3620:
---------------------------------------
Kylin, if you don't already have a fix, I do have a commit ready for this.
> HBase translator - date, time, timestamp values are not translated correctly
> ----------------------------------------------------------------------------
>
> Key: TEIID-3620
> URL: https://issues.jboss.org/browse/TEIID-3620
> 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
> Attachments: insert.log, select.log, update.log
>
>
> Using date/time/timestamp value in SQL query causes an exception [1] - {ts '...'}/{d '...'}/{t '...'} is not supported by Phoenix Driver.The issue is present in all types of statements (select, insert, update).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 7 months
[JBoss JIRA] (TEIID-3622) HBase translator - INSERT could rewrite the data
by Juraj Duráni (JIRA)
[ https://issues.jboss.org/browse/TEIID-3622?page=com.atlassian.jira.plugin... ]
Juraj Duráni commented on TEIID-3622:
-------------------------------------
There was probably some misunderstanding. My assumption was that HBase translator could rewrite the data. As you said, the assumption is correct. It means that it is a bug and need to be fixed.
+*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|
> HBase translator - INSERT could rewrite the data
> ------------------------------------------------
>
> Key: TEIID-3622
> URL: https://issues.jboss.org/browse/TEIID-3622
> 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: Steven Hawkins
>
> 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')
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 7 months
[JBoss JIRA] (TEIID-3619) HBase translator - INSERT and UPDATE statements have no effect
by Juraj Duráni (JIRA)
[ 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)
10 years, 7 months