Hello, I would like to enable partition aware data loading. I do have a composite business key in the database (Oracle and SQL Server) that happen to be the key of the object in the key. The most important part of that key is a string
I can very easily compute a good affinity from that key, the problem is that I would like to limit each load to only its subset of the data. Namely, the data that will end up on the partitions of that node. Optimally, I would be able to compute the affinity along with the select that loads the data from the database. That does not work, because the java hashcode function is usually not implementable as a select. In https://apacheignite.readme.io/docs/data-loading#section-partition-aware-data-loading, it is recommended to add a field with the partition id but that means that the data are first loaded in the grid and then loading in the database. This is not my, data are loaded in the DB through an ETL and then we load it in the grid. I do not want to add a technical field in the key (the partition), otherwise it would mean that the business code would have to deal with it. At this point, I considered several alternatives but none of them perform correctly: - Stored procedure in T-SQL and PL-SQL to compute the partition during the select but it is horribly slow - Extracting a number from the composed key in the select : SELECT LENGTH(A) AS L, ascii(SUBSTR(A, LENGTH(A) - 1))+ascii(SUBSTR(A, LENGTH(A) - 2))+ascii(SUBSTR(A, LENGTH(A) - 3))+ascii(SUBSTR(A, LENGTH(A) - 4)) AS K FROM (SELECT 'abcdefgh' AS A FROM DUAL) but this is really ugly - Using ORA_HASH and its SQLServer equivalent but the algorithm is proprietary and I cannot use it in the affinity. Does the community have an opinion on how to best solve that? Thanks a lot in advance -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/