|Caching Data with GemFire XD / Using a RowLoader to Load Existing Data|
GemFire XD only invokes a configured RowLoader when certain conditions are met.
Note that it does not matter which columns are requested or used from the resulting rows.
CREATE TABLE LoaderTest(id INTEGER, name VARCHAR(10), result VARCHAR(10), primary key (id, name));In the "LoaderTest" table, columns "id" and "name" form the primary key. Queries that use an equality test on the primary key invoke an attached loader implementation for the table, if the data was not already available in GemFire XD. For example, these queries would invoke a loader:
SELECT * FROM LoaderTest WHERE id = 5 AND name='Joe'; SELECT result FROM LoaderTest WHERE id = 6 AND name='Sam';
SELECT result FROM LoaderTest WHERE id < 6 AND name='Sam'; SELECT * FROM LoaderTest; SELECT * FROM LoaderTest WHERE id = 5;In the above examples, none of the SELECT statements use an equality test for all components of the primary key (both "id" and "name").