Clone Tools
  • last updated 29 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
[ASTERIXDB-2760][COMP] Improve function call resolution

- user model changes: no

- storage format changes: no

- interface changes: no

Details:

- Refactor function call resolution and perform it earlier,

before GROUP BY expressions are substituted

- Consolidate gby-expr testcases into a single one

- Introduce QueryTranslator.handleDeclareFunctionStatement()

- Rename existing SqlppCaseExpressionVisitor to

SqlppCaseAggregateExtractionVisitor

- Move CASE expression rewriting code from

SqlppBuiltinFunctionRewriteVisitor into a separate visitor:

SqlppCaseExpressionVisitor

- Remove function name normalization code from SqlppAstPrintVisitor

and updated existing reference results

Change-Id: I527ffbff487b8534f66ca27d48788e96c65aec9b

Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/7264

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

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

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

Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>

    • -7
    • +7
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -2
    • +2
    ./cell-aggregation/cell-aggregation.3.ast
    • -3
    • +3
    ./circle-intersect-circle/circle-intersect-circle.3.ast
    • -6
    • +6
    ./circle_accessor/circle_accessor.3.ast
    • -2
    • +2
    ./distance-between-points/distance-between-points.3.ast
    • -3
    • +3
    ./line-intersect-circle/line-intersect-circle.3.ast
    • -1
    • +1
    ./line-intersect-line/line-intersect-line.3.ast
    • -1
    • +1
    ./line-intersect-polygon/line-intersect-polygon.3.ast
    • -1
    • +1
    ./line-intersect-rectangle/line-intersect-rectangle.3.ast
    • -2
    • +2
    ./point-equals-point/point-equals-point.3.ast
    • -3
    • +3
    ./point-in-circle/point-in-circle.3.ast
    • -1
    • +1
    ./point-in-polygon/point-in-polygon.3.ast
    • -1
    • +1
    ./point-in-rectangle/point-in-rectangle.3.ast
  1. … 1148 more files in changeset.
[NO ISSUE][COMP] Minor cleanup in VariableCheckAndRewriteVisitor

- user model changes: no

- storage format changes: no

- interface changes: no

Details:

- VariableCheckAndRewriteVisitor should create FieldAccessor

expressions when resolving identifiers as field accessors.

Currently it produces an internal function call in these cases.

FieldAccessor expressions will be converted into internal

function calls later by LangExpressionToPlanTranslator.

Change-Id: Icaab2a29f787439eebd67e44aa6a9e92df422a98

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

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

Reviewed-by: Till Westmann <tillw@apache.org>

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

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

    • -2
    • +2
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -2
    • +2
    ./cell-aggregation/cell-aggregation.3.ast
  1. … 44 more files in changeset.
[ASTERIXDB-2193][SQLPP] Fix dataverse resolution in functions

- user model changes: yes

- storage format changes: no

- interface changes: no

Details:

- When compiling user-defined function set default dataverse

to be the function's dataverse to correclty resolve dataset

accesses within that function

- Fix incorrect interpretation of quoted dataset names

FROM `a.b` now means FROM default_dataverse.`a.b`

(previously it meant FROM `a`.`b`)

Change-Id: I699b35fb46a739e9fdfcaf5cbfd6a4a00ce4da38

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

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

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

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

Reviewed-by: Till Westmann <tillw@apache.org>

    • -1
    • +1
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -1
    • +1
    ./cell-aggregation/cell-aggregation.3.ast
    • -1
    • +1
    ./circle-intersect-circle/circle-intersect-circle.3.ast
    • -1
    • +1
    ./create-rtree-index/create-rtree-index.3.ast
    • -1
    • +1
    ./distance-between-points/distance-between-points.3.ast
    • -1
    • +1
    ./line-intersect-circle/line-intersect-circle.3.ast
    • -1
    • +1
    ./line-intersect-line/line-intersect-line.3.ast
    • -1
    • +1
    ./line-intersect-polygon/line-intersect-polygon.3.ast
    • -1
    • +1
    ./line-intersect-rectangle/line-intersect-rectangle.3.ast
    • -1
    • +1
    ./point-equals-point/point-equals-point.3.ast
    • -1
    • +1
    ./point-in-circle/point-in-circle.3.ast
    • -1
    • +1
    ./point-in-polygon/point-in-polygon.3.ast
    • -1
    • +1
    ./point-in-rectangle/point-in-rectangle.3.ast
    • -1
    • +1
    ./polygon-intersect-circle/polygon-intersect-circle.3.ast
  1. … 1502 more files in changeset.
[ASTERIXDB-2170][SQL] Fix resolution order of implicit field access

- user model changes: yes

- storage format changes: no

- interface changes: no

Details:

- Improved name resolution rules

- Resolve field access to the nearest variable in scope

instead of raising compile-time error

- Do not rely on type information when resolving names

- Cleanup group variable handling in GroupBy clause,

no longer use ‘with’ map for it

- Fix ByNameToByIndexFieldAccessRule to use type environment

of its input operator when analyzing its expression

- Fix ExternalGroupByPOperator to use input schema of its

aggregate function when generating runtime for that function

- Fix invalid free variable computation for GroupBy clause

Change-Id: I50bc823ff53da06507a5454b30f4f500b862d4bf

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

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

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

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

    • -1
    • +6
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -3
    • +2
    ./cell-aggregation/cell-aggregation.3.ast
  1. … 313 more files in changeset.
[NO ISSUE][COMP] Function references cleanup

- user model changes: no

- storage format changes: no

- interface change: no

Details: cleanup function references

- Use function identifiers when referring to built-in functions

- Use OperatorType enum when referring to operators

- Add FunctionSignature constructor that takes FunctionIdentifier

- Use asterix/algebricks namespace when referring to built-in functions

Change-Id: Ibad290182ed0f248f65987df97e6c61aac95b232

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

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

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

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

Reviewed-by: Ian Maxon <imaxon@apache.org>

Reviewed-by: Taewoo Kim <wangsaeu@gmail.com>

    • -1
    • +1
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -2
    • +2
    ./cell-aggregation/cell-aggregation.3.ast
    • -1
    • +1
    ./circle-intersect-circle/circle-intersect-circle.3.ast
    • -1
    • +1
    ./create-rtree-index/create-rtree-index.3.ast
    • -1
    • +1
    ./distance-between-points/distance-between-points.3.ast
    • -1
    • +1
    ./line-intersect-circle/line-intersect-circle.3.ast
    • -1
    • +1
    ./line-intersect-line/line-intersect-line.3.ast
    • -1
    • +1
    ./line-intersect-polygon/line-intersect-polygon.3.ast
    • -1
    • +1
    ./line-intersect-rectangle/line-intersect-rectangle.3.ast
    • -1
    • +1
    ./point-equals-point/point-equals-point.3.ast
    • -1
    • +1
    ./point-in-circle/point-in-circle.3.ast
    • -1
    • +1
    ./point-in-polygon/point-in-polygon.3.ast
    • -1
    • +1
    ./point-in-rectangle/point-in-rectangle.3.ast
    • -1
    • +1
    ./polygon-intersect-circle/polygon-intersect-circle.3.ast
  1. … 1569 more files in changeset.
[ASTERIXDB-2078][SQL] DISTINCT modifier for aggregate functions

- user model changes: yes

- storage format changes: no

- interface changes: no

Details:

- Adds support for DISTINCT modifier in aggregate functions:

AGG(DISTINCT expr), ARRAY_AGG(DISTINCT expr), COLL_AGG(DISTINCT expr)

where AGG = COUNT | SUM | AVG | MIN | MAX

Change-Id: I52772349cbcbfc68a3a1ff261d610871ca38748d

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

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

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

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

Reviewed-by: Till Westmann <tillw@apache.org>

    • -4
    • +4
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -1
    • +1
    ./cell-aggregation/cell-aggregation.3.ast
  1. … 360 more files in changeset.
[ASTERIXDB-1753][SQL] Disable auto-plural for group-by.

- user model changes: do not perform auto-scalar-to-plural

transition for variables that are defined prior to a group-by

group clause after the group-by clause.

- storage format changes: no

- interface changes: no

details:

- migrated existing test queries that use auto-plural;

- added a negative test query.

Change-Id: I5d6383fc7453fe7537fc291c3483708b59df3871

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

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

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

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

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

    • -2
    • +9
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -2
    • +13
    ./cell-aggregation/cell-aggregation.3.ast
  1. … 260 more files in changeset.
ASTERIXDB-1539: add aliases for several builtin types and builtin functions.

- tinyint for int8;

- smallint for int16;

- integer(or, int) for int32;

- bigint for int64;

- year_month_duration for year-month-duration;

- day_time_duration for day-time-duration;

- timestamp for datetime;

- double precision for double;

int8, int16, int32, int64, year-month-duration and day-time-duration

is going to be deprecated.

In addition, it

- converts underscores to hypens for SQL++ functions;

- uses "array_" prefix for builtin aggregation functions.

Change-Id: I5c4a933f9775e89c2d503d9ea1cb98c5934d1475

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

Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>

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

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

Reviewed-by: Yingyi Bu <buyingyi@gmail.com>

    • -2
    • +2
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.1.ast
    • -1
    • +1
    ./cell-aggregation/cell-aggregation.1.ast
    • -1
    • +1
    ./circle-intersect-circle/circle-intersect-circle.1.ast
    • -1
    • +1
    ./create-rtree-index/create-rtree-index.1.ast
    • -1
    • +1
    ./distance-between-points/distance-between-points.1.ast
    • -1
    • +1
    ./line-intersect-circle/line-intersect-circle.1.ast
    • -1
    • +1
    ./line-intersect-line/line-intersect-line.1.ast
    • -1
    • +1
    ./line-intersect-polygon/line-intersect-polygon.1.ast
    • -1
    • +1
    ./line-intersect-rectangle/line-intersect-rectangle.1.ast
    • -1
    • +1
    ./point-equals-point/point-equals-point.1.ast
    • -1
    • +1
    ./point-in-circle/point-in-circle.1.ast
    • -1
    • +1
    ./point-in-polygon/point-in-polygon.1.ast
    • -1
    • +1
    ./point-in-rectangle/point-in-rectangle.1.ast
    • -1
    • +1
    ./polygon-intersect-circle/polygon-intersect-circle.1.ast
  1. … 3547 more files in changeset.
Clean up GROUP BY and WITH clause.

- fix ASTERIXDB-971, i.e., the expression to plan translator for FLWOGR without a "for";

- fix the scoping for nested WITH clause;

- fix the scoping for nested GROUP BY clause;

- fix default fields in group variables;

- fix/unify the expression substition AST visitor;

- enhance RemoveUnusedAssignAndAggregateRule to be able to remove unused GROUP BY

decoration varaibles;

- clearly sperate SQL++ aggregate functions and SQL-92 aggregate functions, i.e.,

SQL-92 aggregate sugars cannot apply to SQL++ aggregate functions;

- fix PushAggregateIntoGroupbyRule for nested plan deletions;

- enhance RemoveCartesianProductWithEmptyBranchRule;

- add ExtractGroupByDecorVariablesRule;

- add an aggregate function first-element;

- fix ASTERIXDB-1560, an error message issue.

Change-Id: I62fca7f937aa007d97ed87c75cef19f6aa3e5ade

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

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

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

Reviewed-by: Till Westmann <tillw@apache.org>

    • -13
    • +1
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -11
    • +1
    ./cell-aggregation/cell-aggregation.3.ast
  1. … 234 more files in changeset.
Add EXISTS/NOT EXISTS.

- Fixed the precedence order of NOT.

Change-Id: I7ec20753659e2de2fd65e5f858e0f73796b907d0

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

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

Reviewed-by: Till Westmann <tillw@apache.org>

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

    • -1
    • +1
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -1
    • +1
    ./rectangle-intersect-rectangle/rectangle-intersect-rectangle.3.ast
  1. … 66 more files in changeset.
ASTERIXDB-1383: reduce the number of lines for "AS".

Change-Id: Ic655bf25701f33230787d175b78bedc489909cb0

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

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

Reviewed-by: Till Westmann <tillw@apache.org>

    • -12
    • +6
    ./cell-aggregation-with-filtering/cell-aggregation-with-filtering.3.ast
    • -10
    • +5
    ./cell-aggregation/cell-aggregation.3.ast
    • -2
    • +1
    ./circle-intersect-circle/circle-intersect-circle.3.ast
    • -2
    • +1
    ./create-rtree-index/create-rtree-index.3.ast
    • -2
    • +1
    ./distance-between-points/distance-between-points.3.ast
    • -2
    • +1
    ./line-intersect-circle/line-intersect-circle.3.ast
    • -2
    • +1
    ./line-intersect-line/line-intersect-line.3.ast
    • -2
    • +1
    ./line-intersect-polygon/line-intersect-polygon.3.ast
    • -2
    • +1
    ./line-intersect-rectangle/line-intersect-rectangle.3.ast
    • -2
    • +1
    ./point-equals-point/point-equals-point.3.ast
    • -2
    • +1
    ./point-in-circle/point-in-circle.3.ast
    • -2
    • +1
    ./point-in-polygon/point-in-polygon.3.ast
    • -2
    • +1
    ./point-in-rectangle/point-in-rectangle.3.ast
  1. … 1705 more files in changeset.