Clone Tools
  • last updated 22 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>

    • -28
    • +28
    ./accessors_interval/accessors_interval.3.ast
    • -2
    • +2
    ./accessors_interval_null/accessors_interval_null.3.ast
    • -10
    • +10
    ./adjust_timezone/adjust_timezone.3.ast
    • -80
    • +80
    ./calendar_duration/calendar_duration.3.ast
    • -46
    • +46
    ./date_functions/date_functions.3.ast
    • -51
    • +51
    ./datetime_functions/datetime_functions.3.ast
    • -11
    • +11
    ./day_of_week_01/day_of_week_01.3.ast
    • -30
    • +30
    ./duration_comps/duration_comps.3.ast
    • -13
    • +13
    ./duration_functions/duration_functions.3.ast
    • -42
    • +42
    ./get_overlapping_interval/get_overlapping_interval.3.ast
    • -29
    • +29
    ./interval_bin/interval_bin.3.ast
    • -4
    • +4
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -5
    • +5
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -71
    • +71
    ./interval_functions/interval_functions.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
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
  1. … 45 more files in changeset.
[ASTERIXDB-2286][COMP][FUN][HYR] Parallel Sort Optimization

- user model changes: yes

- storage format changes: no

- interface changes: yes

details:

- new plan for sort operation which includes sampling and

replicating the stream of data to be sorted. Sort-merge connector

is removed from the plan. The sorted result now is in multiple partitions.

- new optimization rule to check whether full parallel sort is applicable.

- new Forward operator to read the replicated sort input stream and

to receive the ouput of the sampling.

- new sequential merge connector to merge a globally ordered result residing

in multiple partitions (in addition to the connector's partition computer).

- "asterix-lang-aql/pom.xml" is changed as a result of refactoring

code related to the range map handling.

- new private sampling function to generate the range map object

(local & global functions) & their type computers.

user model changes:

- new compiler property is added to enable and disable parallel sort.

interface changes:

- "ILogicalOperatorVisitor.java" includes Forward Operator.

- "ITuplePartitionComputer.java" includes initialize() to enable partitioner

to do some initialization. FieldRangePartitionComputerFactory uses it to

pick a range map.

- "ITuplePartitionComputerFactory.java". createPartitioner() is changed to

createPartitioner(IHyracksTaskContext hyracksTaskContext). Context is needed

for transferring the range map throught the context.

Change-Id: I73e128029a46f45e6b68c23dfb9310d5de10582f

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

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: Dmitry Lychagin <dmitry.lychagin@couchbase.com>

    • -0
    • +10
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
  1. … 357 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
    ./insert_from_ext_ds/insert_from_ext_ds.3.ast
    • -1
    • +1
    ./insert_from_ext_ds_2/insert_from_ext_ds_2.3.ast
    • -1
    • +1
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -1
    • +1
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -1
    • +1
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -1
    • +1
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -3
    • +3
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 1510 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>

    • -3
    • +2
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -10
    • +3
    ./overlap_bins_gby_1/overlap_bins_gby_1.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
    ./insert_from_ext_ds/insert_from_ext_ds.3.ast
    • -1
    • +1
    ./insert_from_ext_ds_2/insert_from_ext_ds_2.3.ast
    • -1
    • +1
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -1
    • +1
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -2
    • +2
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -1
    • +1
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -3
    • +3
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 1577 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>

    • -1
    • +1
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -1
    • +1
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -2
    • +2
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -4
    • +4
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 358 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
    • +13
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -10
    • +17
    ./overlap_bins_gby_1/overlap_bins_gby_1.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
    ./insert_from_ext_ds/insert_from_ext_ds.1.ast
    • -2
    • +2
    ./insert_from_ext_ds_2/insert_from_ext_ds_2.1.ast
    • -1
    • +1
    ./interval_bin_gby_0/interval_bin_gby_0.1.ast
    • -1
    • +1
    ./interval_bin_gby_1/interval_bin_gby_1.1.ast
    • -2
    • +2
    ./overlap_bins_gby_0/overlap_bins_gby_0.1.ast
    • -2
    • +2
    ./overlap_bins_gby_1/overlap_bins_gby_1.1.ast
    • -2
    • +2
    ./overlap_bins_gby_3/overlap_bins_gby_3.1.ast
  1. … 3555 more files in changeset.
ASTERIXDB-1635 Fix for overlap-bins start for dates.

The fix involves two code changes and several sonar fixes.

The code changes are the following:

- DurationArithmeticOperations line 75:

When the month was zero, an index out of bound error occured in line 88 or 92.

The month value should be between 1 and 12.

- OverlapBinsDescriptor line 170:

The Gregorian Calendar is expecting a value in ms. When a date value comes in,

AsterixDB represents the value as the number of days from epoc. So the year

for a date basically allways translated to 1970. In lines 121, a condition

was added to check if the interval was a date, if so, convert the date to

ms.

Change-Id: I24122a84ef9edda4b05260af881c430177f1dc86

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

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

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

Reviewed-by: Steven Jacobs <sjaco002@ucr.edu>

    • -0
    • +26
    ./datetime_functions/datetime_functions.3.ast
  1. … 10 more files in changeset.
ASTERIXDB-1635 Fix for overlap-bins start for dates.

  1. … 7 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>

    • -1
    • +1
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -1
    • +1
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -1
    • +0
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 233 more files in changeset.
Support implicit variable name and column name.

1. Support WITH clause for general cases;

2. Fixed open/closed type optimization;

3. Fixed scoping for nested aggregations;

4. Fixed side effects during partition property analysis;

5. Fixed type propagation policy for Subplan operator.

Change-Id: I409b9ba139c9f000a6b9b84d519d172d0069e4bb

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

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

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

    • -4
    • +4
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 231 more files in changeset.
Add IS (NOT) NULL/MISSING/UNKOWN.

Change-Id: I7e4008d97f0d3a92816b90492dd8c887b05bac27

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

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

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

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

  1. … 43 more files in changeset.
Adding functions to return unit-time from date, datetime, and time.

Change-Id: I5a71d73680d2ad47e5bb2c2d9ceec2ec0d676d09

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

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

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

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

    • -1
    • +17
    ./date_functions/date_functions.3.ast
    • -0
    • +32
    ./datetime_functions/datetime_functions.3.ast
    • -0
    • +16
    ./time_functions/time_functions.3.ast
  1. … 16 more files in changeset.
Let SQL-92 aggregate functions behave the same as SQL-92.

Change-Id: Ia2929d1ca6344508bbf772884ea8ef1f39a0e19f

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

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

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

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

    • -1
    • +1
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -1
    • +1
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -1
    • +1
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -2
    • +2
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 90 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>

    • -2
    • +1
    ./insert_from_ext_ds/insert_from_ext_ds.3.ast
    • -2
    • +1
    ./insert_from_ext_ds_2/insert_from_ext_ds_2.3.ast
    • -8
    • +4
    ./interval_bin_gby_0/interval_bin_gby_0.3.ast
    • -8
    • +4
    ./interval_bin_gby_1/interval_bin_gby_1.3.ast
    • -16
    • +8
    ./overlap_bins_gby_0/overlap_bins_gby_0.3.ast
    • -16
    • +8
    ./overlap_bins_gby_1/overlap_bins_gby_1.3.ast
    • -18
    • +9
    ./overlap_bins_gby_3/overlap_bins_gby_3.3.ast
  1. … 1713 more files in changeset.
great merge - asterixdb

    • -0
    • +465
    ./interval_functions/interval_functions.3.ast
  1. … 555 more files in changeset.