ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergi Vladykin <sergi.vlady...@gmail.com>
Subject Re: [EXTERNAL] Re: class org.apache.ignite.IgniteCheckedException: Failed to register query type: TypeDescriptor
Date Tue, 06 Sep 2016 15:59:12 GMT
I guess it is either not the same error or you run the old code or
something like this.

Please make sure that there is no mistake: restart clean cluster, rebuild
the code and run it again.

Sergi

2016-09-06 16:19 GMT+03:00 Chetan.V.Yadav <Chetan.V.Yadav@target.com>:

> Hi,
>
>  I changed the variable to “todayData" from “today” in SalesModel but
> still getting same error.
>
> /** TdyFeedModel: todayData (not-indexed). */
>
> @QuerySqlField
>
> public TdyFeedModel todayData;
> --
> Regards,
> Chetan.
>
> From: Sergi Vladykin <sergi.vladykin@gmail.com>
> Reply-To: "user@ignite.apache.org" <user@ignite.apache.org>
> Date: Tuesday, September 6, 2016 at 5:18 PM
> To: "user@ignite.apache.org" <user@ignite.apache.org>
> Subject: [EXTERNAL] Re: class org.apache.ignite.IgniteCheckedException:
> Failed to register query type: TypeDescriptor
>
> Hi!
>
> The name `TODAY` is problematic because there is a function with the same
> name.
>
> Sergi
>
> 2016-09-06 12:40 GMT+03:00 chevy <chetan.v.yadav@target.com>:
>
>> Hi,
>>
>>  I am getting "Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in
>> SQL
>> statement "CREATE TABLE ""salesCache"".SALESMODEL (_KEY INT NOT NULL,_VAL
>> OTHER,ID VARCHAR,STOREID INT,DATE VARCHAR,GOAL DOUBLE,FORECAST
>> DOUBLE,HOURLYSALES OTHER,SALESDATE VARCHAR,TODAY[*] OTHER,TYSALES
>> DOUBLE,LYSALES DOUBLE,TYTRANSACTIONCOUNT DOUBLE,LYTRANSACTIONCOUNT
>> DOUBLE,TYAVERAGEBASKETSIZE DOUBLE,LYAVERAGEBASKETSIZE DOUBLE,PREVIOUSDAY
>> OTHER,WEEKTODATE OTHER,MONTHTODATE OTHER) ENGINE "
>> "org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine""
>> ";
>> expected "identifier"; SQL statement:
>> CREATE TABLE "salesCache".SalesModel (_key INT NOT NULL,_val OTHER,id
>> VARCHAR,storeId INT,date VARCHAR,goal DOUBLE,forecast DOUBLE,hourlySales
>> OTHER,salesDate VARCHAR,today OTHER,tySales DOUBLE,lySales
>> DOUBLE,tyTransactionCount DOUBLE,lyTransactionCount
>> DOUBLE,tyAverageBasketSize DOUBLE,lyAverageBasketSize DOUBLE,previousDay
>> OTHER,weekToDate OTHER,monthToDate OTHER) engine
>> "org.apache.ignite.internal.processors.query.h2.opt.GridH2Table$Engine"
>> error.
>>
>> I have attached complete log in this post. I am not able to understand how
>> my data is affecting creating of cache schema and table.
>>
>> I am adding data to cache in below format -
>>
>> "cache.putAll(finalMap)" and cache is of format "IgniteCache<Integer,
>> SalesModel> cache". "finalMap" looks like "finalMap.put(storeId,
>> salesModel)". SalesModel structure is shown below -
>>
>> package com.ignite.model.sales;
>>
>> import java.io.Serializable;
>> import java.sql.Date;
>>
>> import org.apache.ignite.cache.query.annotations.QuerySqlField;
>>
>> public class SalesModel implements Serializable {
>>
>>         private static final long serialVersionUID = 1L;
>>
>>         /** SalesModel: id (not-indexed). */
>>         @QuerySqlField
>>         public String id;
>>
>>         /** SalesModel: storeId (not-indexed). */
>>         @QuerySqlField
>>         public int storeId;
>>
>>         /** SalesModel: date (not-indexed). */
>>         @QuerySqlField
>>         public String date;
>>
>>         /** TdyFeedModel: tdy (not-indexed). */
>>         @QuerySqlField
>>         public TdyFeedModel day;
>>
>>         /** YstFeedModel: yst (not-indexed). */
>>         @QuerySqlField
>>         public WtdFeedModel previousDay;
>>
>>         /** WtdFeedModel: wtd (not-indexed). */
>>         @QuerySqlField
>>         public WtdFeedModel weekToDate;
>>
>>         /** MtdFeedModel: mtd (not-indexed). */
>>         @QuerySqlField
>>         public MtdFeedModel monthToDate;
>>
>>         //setters and getters for all variables
>> }
>>
>> Cache config is as shown below -
>> /* Initialize cache configuration */
>>                         cacheCfg.setName("salesCache");
>>                         cacheCfg.setCacheMode(CacheMode.REPLICATED);
>>                         cacheCfg.setSwapEnabled(false);
>>                         cacheCfg.setOffHeapMaxMemory(0);
>>                         cacheCfg.setCopyOnRead(false);
>>
>> cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizati
>> onMode.FULL_SYNC);
>>                         cacheCfg.setAtomicWriteOrderMo
>> de(CacheAtomicWriteOrderMode.CLOCK);
>>                         cacheCfg.setIndexedTypes(Integer.class,
>> SalesModel.class);
>>
>>                         /* Start Ignite node. */
>>                         String path = "src/main/java/com/ignite/config/";
>>                         Ignite ignite = Ignition.start(path +
>> "mpm-ignite.xml");
>>
>>                         try (IgniteCache<Integer, SalesModel> cache =
>> ignite.getOrCreateCache(cacheCfg)) {
>>                                 if (ignite.cluster().forDataNodes
>> (cache.getName()).nodes().isEmpty()) {
>>                                         ...
>>                                 }
>>
>>                                 // Put created data entries to cache.
>>                                 cache.putAll(finalMap);
>>
>> log.txt <http://apache-ignite-users.70518.x6.nabble.com/file/n7543/
>> log.txt>
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/class-org-apache-ignite-IgniteCheckedExcept
>> ion-Failed-to-register-query-type-TypeDescriptor-tp7543.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Mime
View raw message