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(CacheWriteSynchronizationMode.FULL_SYNC);
cacheCfg.setAtomicWriteOrderMode(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.70518.x6.nabble.com/class-org-apache-ignite-IgniteCheckedException-Failed-to-register-query-type-TypeDescriptor-tp7543.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.