You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by codeboyyong <co...@gmail.com> on 2019/11/14 22:29:50 UTC

Set the partitions when create table in the code

Hi Dear ignite friends
I have a uniq use case here . I have to create a table in a big ignite
cluster and since the columns and table name are dynamically generated. I
can not config the cache config in the xml.
So I use the SQL to create the table .
The thing is , seems there is no way to config the partition numbers for the
table. The default value 1024 is quite small and not suit on our use case.

Can some one pls let me know if there is a solution for this ?
Please note that I can not configure the cache config in the xml, because
the table columns and names are generated on runtime. 

Thank You



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

RE: Set the partitions when create table in the code

Posted by codeboyyong <co...@gmail.com>.
Hi Alexandr,
Thanks for the fast reply. After I use the template in the create table sql 
statement, It works, I can set the partition numbers through affinity
property .
Thanks so much for you help. Really appreciate it .

Yong



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

RE: Set the partitions when create table in the code

Posted by Alexandr Shapkin <le...@gmail.com>.
Have you tried a cache template [1]?



After you designed your custom affinity function, you can configure it for a
new cache template.

You could use it with the CREATE TABLE statement [2].

Please, note, that a template should be registered in advance.



[1] - <https://apacheignite.readme.io/docs/cache-template>

[2] - <https://apacheignite-sql.readme.io/docs/create-table#section-
parameters>



 **From:**[codeboyyong](mailto:codeboyyong@gmail.com)  
 **Sent:** Friday, November 15, 2019 1:29 AM  
 **To:**[user@ignite.apache.org](mailto:user@ignite.apache.org)  
 **Subject:** Set the partitions when create table in the code



Hi Dear ignite friends

I have a uniq use case here . I have to create a table in a big ignite

cluster and since the columns and table name are dynamically generated. I

can not config the cache config in the xml.

So I use the SQL to create the table .

The thing is , seems there is no way to config the partition numbers for the

table. The default value 1024 is quite small and not suit on our use case.



Can some one pls let me know if there is a solution for this ?

Please note that I can not configure the cache config in the xml, because

the table columns and names are generated on runtime.



Thank You







\--

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