ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Magda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-6785) Affinity field name forced to be upper-case
Date Fri, 27 Oct 2017 21:22:04 GMT
Denis Magda created IGNITE-6785:

             Summary: Affinity field name forced to be upper-case
                 Key: IGNITE-6785
                 URL: https://issues.apache.org/jira/browse/IGNITE-6785
             Project: Ignite
          Issue Type: Task
      Security Level: Public (Viewable by anyone)
          Components: sql
    Affects Versions: 2.1
            Reporter: Denis Magda
             Fix For: 2.4

If an SQL schema and cache is created with CREATE TABLE command and a user wants to use key-value
APIs creating its own custom key class, then (at least) the key  class's affinity field forced
to be written in upper-case.

Steps to reproduce using the project attached:
* start a node with {{./ignite.sh ../examples/config/example-ignite.xml}}.
* create {{City}} table using {{ignite_world.sql}}. SQLline is one of the quickest ways: https://apacheignite-sql.readme.io/docs/sqlline
* Run {{KeyValueDataProcessing}} to catch the exception below
Exception in thread "main" class org.apache.ignite.binary.BinaryObjectException: Binary type
has different affinity key fields [typeName=demo.model.CityKey, affKeyFieldName1=COUNTRYCODE,
	at org.apache.ignite.internal.binary.BinaryUtils.mergeMetadata(BinaryUtils.java:987)

If fact {{CityKey}} names the affinity field in the same way as in CREATE TABLE - {{countryCode}}.

Next, run {{KeyValueBinaryDataProcessing}} to spot another weird thing:
* BinaryObject key accepts `countryCode` as the affinity field name.
* If to print our a binary object value then all the fields are in the upper-case (they were
not defined this way in CREATE TABLE):
demo.model.City [idHash=1613627715, hash=-1386587499, DISTRICT=Noord-Holland, POPULATION=711200,

This message was sent by Atlassian JIRA

View raw message