Skip to content

Query transformator

G-Art edited this page Jan 15, 2021 · 4 revisions

Query transformator

The query transformation process that executed before performing used to solve two problems.

  1. Creating query context
  2. Amment item type name to table name and attribute names to column names, adjust inheritance.

During transformation process system collect information about query like what types are used. This information will be used for cache segment calculation.

Transformation process looking for points for data injection as an example of these points are table name and attributes name :

Example:

SELECT * FROM <'table | item' name> as alias

If you use asterisc instead of explicit columns names it will b amended columns that are present in corresponded table:

Query transformation example:

Source:

SELECT * FROM Product AS p

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

Result:

SELECT p.c_productShippable, 
       p.c_dateAvailable, 
       p.c_preOrder, 
       p.c_available, 
       p.c_store, 
       p.c_code, 
       p.c_manufacturer, 
       p.uuid, 
       p.c_updateDate, 
       p.c_createDate, 
       p.c_metaType 
FROM t_abstractproduct AS p 
WHERE p.c_metaType IN ('e2f2f3a6-3381-405f-9010-8f4cc6ef072e', 
                       'a9d313f1-5a3e-46b7-8472-3fc5a7350bec', 
                       '71edd800-f5b5-4097-991c-e0c91a498564', 
                       'c4608532-2f1a-4049-8fef-09165a1cc6fd')
Clone this wiki locally