You can translate the question and the replies:

No data returned when activating cache

Hi, I'm folowwing the tutorial and at page https://community.denodo.com/tutorials/browse/basics/5cache3types, the request returns no row when activating cache. It relates to "client_with_bills" view. Please help, Thank you
user
06-04-2020 04:09:00 -0400

6 Answers

Hi, I am assuming you are facing this problem when using the cache in full mode. In full cache, all of the view’s underlying data will be loaded into the cache, and all queries will only go to the cache. So the reason your query is returning 0 rows is probably because the cache has not been explicitly loaded and the query is trying to query data from an empty cache. For more information on full mode cache and how to load it, refer to [Full Mode](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/cache_module/cache_modes/full_mode) document. Hope this helps!
Denodo Team
07-04-2020 15:00:47 -0400
Ok indeed you are right. Yet another problem arises: If i edit the VQL text to add "CONTEXT('cachepreload' = 'true')" at the end of the SELECT statement, then: 1) It still returns zero row :-( 2) It simply replaces my text with => "CONTEXT ('formatted' = 'yes')". Which makes really strange... Thank you, José
user
08-04-2020 03:41:47 -0400
The VQL is this : CREATE OR REPLACE VIEW client_with_bills FOLDER = '/1 - fist steps/3 - derived views' AS SELECT personal_data_crm.name AS name, personal_data_crm.surname AS surname, personal_data_crm.street AS street, personal_data_crm.city AS city, personal_data_crm.zip AS zip, personal_data_crm.state AS state, personal_data_crm.primary_phone AS primary_phone, personal_data_crm.client_id AS client_id, personal_data_crm.client_type AS client_type, personal_data_crm.code AS code, personal_data_crm.value AS value, billing_information.ssn AS ssn, billing_information.billing_end_date AS billing_end_date, billing_information.phone_center AS phone_center, billing_information.due_date AS due_date, billing_information.balance AS balance, billing_information.billing_period_id AS billing_period_id, billing_information.billing_start_date AS billing_start_date, billing_information.billing_id AS billing_id, billing_information.return_customer_id AS return_customer_id, billing_information.package_id AS package_id, billing_information.amount_due AS amount_due, billing_information.tax_id AS tax_id FROM billing_information AS billing_information INNER JOIN personal_data_crm AS personal_data_crm ON billing_information.customer_id = personal_data_crm.client_id CONTEXT ('formatted' = 'yes'); ALTER VIEW client_with_bills LAYOUT (billing_information = [520, 40, 200, 225], personal_data_crm = [20, 20, 200, 225]); ALTER VIEW client_with_bills CACHE PARTIAL BATCHSIZEINCACHE DEFAULT TIMETOLIVEINCACHE 3600;
user
08-04-2020 03:45:57 -0400
Hi, It seems that there are few issues which needs to be checked and resolved: 1. Make sure you use ‘cache_preload’ instead of ‘cachepreload’. 2. It looks like you are trying to add the context clause directly into the definition of the view rather than as something when you are querying the view. Add the context clause at the end of the SELECT statement when querying the view. For example: SELECT * FROM client_with_bills CONTEXT ( 'cache_preload' = 'true') 3. Based on the VQL of your view, you are using a partial cache. However, based on our initial conversation, I thought you are using a full mode cache. Make sure you are using the right mode of cache for your view. Hope this helps!
Denodo Team
15-04-2020 12:31:41 -0400
Hi, Thank you, I tried to append CONTEXT ( ‘cachepreload’ = ‘true’) into the query but it says "com.denodo.vdb.admin.model.vdbserverproxy.VDBServerProxyException: Syntax error: Exception parsing query near 'cache_preload'" CREATE OR REPLACE VIEW personal_data_crm FOLDER = '/1 - fist steps/3 - derived views' AS SELECT client.name AS name, client.surname AS surname, address.street AS street, address.city AS city, address.zip AS zip, address.state AS state, address.primary_phone AS primary_phone, client.client_id AS client_id, client.client_type AS client_type, client_type.code AS code, client_type.value AS value FROM (client AS client INNER JOIN address AS address ON client.client_id = address.client_fid ) INNER JOIN client_type AS client_type ON client.client_type = client_type.code CONTEXT ( ‘cache_preload’ = ‘true’); ALTER VIEW personal_data_crm LAYOUT (client = [104, 238, 200, 106], address = [392, 123, 200, 146], client_type = [524, 393, 200, 66]); ALTER VIEW personal_data_crm CACHE FULL BATCHSIZEINCACHE DEFAULT TIMETOLIVEINCACHE DEFAULT; Regards, José
user
16-04-2020 04:15:56 -0400
Hi, The cache_preload CONTEXT clause helps you to load the cache in the VQL shell. You need to first load the entire view by running SELECT * FROM view_name CONTEXT(‘cache_preload’ = ‘true’) statement in the VQL shell before applying the conditions. From your code, I can see that you are using this CONTEXT clause in your DDL statement, CREATE, which should not be the case. You need to load the cache in a DML statement such as SELECT. Hope this helps!
Denodo Team
04-05-2020 15:13:22 -0400
You must sign in to add an answer. If you do not have an account, you can register here