[ASTERIXDB-2468] Extend CountVarToCountOneRule to support no group-by - user model changes: no - storage format changes: no - interface changes: no
Details: - Extend CountVarToCountOneRule to support the no group-by case so that count queries without group-by can be handled as well. - Also extend this rule to support SQL_COUNT. In this case, count(v) is replaced with count(1) only v is not nullable.
[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.