Clone
Ali Alsuliman <ali.al.solaiman@gmail.com>
committed
on 05 Nov 18
[NO ISSUE][COMP] fix resolving PK field accesses & rewriting of meta()
- user model changes: no
- storage format changes: no
- interface cha… Show more
[NO ISSUE][COMP] fix resolving PK field accesses & rewriting of meta()

- user model changes: no

- storage format changes: no

- interface changes: no

details:

This patch fixes resolving PK field accesses to the primary key

variable (e.g. $ds.getField("id") is turned into $13 where id is a PK).

The fix considers whether the PK is coming from the data record or the

meta record.

The patch also includes fixing rewriting of meta() references and

replacing them with their corresponding meta variables. Now nested plans

are visited also when looking for meta() references to take care of cases

where the data scan producing the meta variable and the meta() references

happen to be inside the nested plans.

MetaFunctionToMetaVariable() is fired also after the rules which eliminate

subplans to allow for rewriting of the meta() if it couldn't be replaced

when the meta() reference was in the subplan but referring to meta variable

outside the nested plan.

ReinferAllTypesRule() is now fired before ByNameToByIndexFieldAccessRule()

to allow the latter rule to get the up-to-date types in the whole plan.

Change-Id: I2d38cbfcc4a0eee51abf753a7d958dafa666aabf

Reviewed-on: https://asterix-gerrit.ics.uci.edu/3018

Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>

Show less