Hi,
> I realized that the error disappears if I hard code the typeName while
> constructing the BinaryObjectBuilder.
> ignite.binary().builder("ConstantString”);
What was returned as the type name before? As I see from your code that you
used some getter to retrieve the name.
> 1. What is the significance of the typeName except the fact that it is used
> while querying?
The biggest areas where the typeName is required are the following.
The typeName is used by Ignite marshallers (serializers) to hold information
regarding the object type in the serialized form. This information is used
later when an object needs to be deserialized.
And as you mentioned it’s needed for SQL queries to be operational.
> 2. What are the guidelines for specifying typeNames?
There are no any specific guidelines for this. By default Ignite converts the
name to lower case and gets an unique ID from it. This ID is stored in the
serialized form and used in many places of the system.
> 3. In my use case I have few columns that are keyColumns while others are
> not (I am loading a table into ignite). Do I need to have all column values
> part of the value object in order to have the ability to execute a single
> sql query to fetch them? Is there a better way to build the cache object in
> order to have a single query to fetch all the column values of the object
> (that are part of the cache key and value)?
The columns can be located in both a key and a value. The column names must be
unique across the key and the value. After that you can use basic SQL query to
get a result set basing on columns’ values.
BTW, if you have POJOs for your data model then you can directly work with
them. BinaryObjectBuilder is most often used on server nodes, that don’t have
object class in the classpath. On the client side it’s ok to use POJOs because
client side usually have all the classes that are used by an app. Refer to this
page [1] for more info on binary protocol and BinaryObjectBuilder.
[1] https://apacheignite.readme.io/docs/binary-marshaller
<https://apacheignite.readme.io/docs/binary-marshaller>
—
Denis
> On Jun 30, 2016, at 4:11 PM, pragmaticbigdata <[email protected]> wrote:
>
> I realized that the error disappears if I hard code the typeName while
> constructing the BinaryObjectBuilder.
> ignite.binary().builder("ConstantString");
>
> Few questions based on this
> 1. What is the significance of the typeName except the fact that it is used
> while querying?
> 2. What are the guidelines for specifying typeNames?
> 3. In my use case I have few columns that are keyColumns while others are
> not (I am loading a table into ignite). Do I need to have all column values
> part of the value object in order to have the ability to execute a single
> sql query to fetch them? Is there a better way to build the cache object in
> order to have a single query to fetch all the column values of the object
> (that are part of the cache key and value)?
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Error-while-loading-data-into-cache-with-BinaryObject-as-key-field-tp6014p6019.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.