Bug 1242945 - Infinispan-dsl-cache translator: Comparison operators don't work for Char column
Summary: Infinispan-dsl-cache translator: Comparison operators don't work for Char column
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: CR2
: 6.2.0
Assignee: David Le Sage
QA Contact: Filip Elias
URL:
Whiteboard:
: 1242952 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-14 13:08 UTC by Filip Elias
Modified: 2015-09-29 00:56 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-09-29 00:56:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
server log (17.53 KB, text/plain)
2015-07-14 13:10 UTC, Filip Elias
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-3571 0 Major Open Infinispan-dsl-cache translator: Comparison operators don't work for char column 2015-09-30 13:29:58 UTC

Description Filip Elias 2015-07-14 13:08:27 UTC
Comparison operators returns wrong result for column of type Character.

Sample queries:

SELECT CharValue FROM SmallA WHERE SmallA.CharValue < '1'
SELECT CharValue FROM SmallA WHERE SmallA.CharValue = '1'

These queries return no row even though they should have returned more than 20 rows.

Log is in the attachment.

Comment 1 Filip Elias 2015-07-14 13:10:11 UTC
Created attachment 1051837 [details]
server log

Comment 2 Van Halbert 2015-07-16 20:20:38 UTC
*** Bug 1242952 has been marked as a duplicate of this bug. ***

Comment 3 Van Halbert 2015-07-21 00:22:04 UTC
I found the protocol buffers doc on supported data types [1].  Looking at the matrix, there's isn't a specific char type, but only string types.   The char types that are defined in the protobuf file are int32, for which corresponds to an 'int' type.    And when I change the model to correspond, the queries work.

And as part of the next few changes, I've change the data types to be derived from the protobuf definition, instead of the class.  However, if the class isn't defined correctly based on the protobuf, this issue will occur.

[1] https://developers.google.com/protocol-buffers/docs/proto#scalar

Comment 4 Filip Elias 2015-07-21 11:36:39 UTC
Van,

If you change the data type of charValue column to integer (in the Java POJO and the model) then it will no longer be a column of type Char. I know that the protocol buffer doesn't support Char so I set the charValue column to int32 in the proto file and I converted it to/from Char using the marshaller. If this approach doesn't work and there is no other way to make it work, we should specify in the documentation that Char column is not supported for infinispan translator.

Comment 5 Van Halbert 2015-07-21 19:00:31 UTC
To be added to the docs:

-  To determine what the data types that are supported when accessing a JDG Remote Cache and using Google Protobufs for serialization, see [1]


-  Char data type is not currently a supported protobuf data type, use String data type or handle the conversion in the marshaller.



[1]  [1] https://developers.google.com/protocol-buffers/docs/proto#scalar

Comment 6 David Le Sage 2015-09-03 03:37:44 UTC
"Important"-level note detailing this information added to the Reference Guide's "Infinispan DSL Translator" topic.


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