From what I understand, the first cache created by getOrCreate, where you will 
be using to run the SQLFieldsQuery to create your table, is just a dummy.  So 
name it as anything other than "Persons".  Yes.  It may sound counter 
intuitive. I'm still learning so may learn the reason behind it later.
Hope this help.
    On Tuesday, November 20, 2018, 1:51:37 AM EST, siva 
<[email protected]> wrote:  
 
 Hi ,


Thank You for Reply,

*And for question 2, I think, yes, from my learning, SQL Create Table always
create another cache with default naming like SQL_PUBLIC_
. But according to manual, you can override the name by supplying options
after "with".*


IgniteCache cache = ignite.getOrCreateCache(new
CacheConfiguration<>().setSqlSchema("PUBLIC").setName("Persons").setSqlEscapeAll(true));

If i give same cacheName as mentioned in the above configuration  in "With"
cluse getting exception 

cacheName "Persons" already created.

cache.query(new SqlFieldsQuery(
                "CREATE TABLE IF NOT Exists Persons(id LONG PRIMARY KEY,
name VARCHAR,dojurney date) WITH \"template=replicated,CACHE_NAME=Persons
,affinity_key=id\"")).getAll();







--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
  

Reply via email to