Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds projection alias support to ORDER BY clause #740

Merged
merged 10 commits into from
Sep 21, 2022
Merged

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Sep 6, 2022

Related Issues

Description

  • A PR that adds support for projection aliases in ORDER BY -- it does this by rewriting the query in accordance with PartiQL Spec Section 12.5
  • Revisions:
    • 1: Initially created a PR that would essentially compile the projection list twice to evaluate the ORDER BY RHS expression, but after discussing with Yingtao and Robert, I decided to make revision Annotations can be dropped in some circumstances #2
    • 2: Make ORDER BY go AFTER projection. However -- this was wrong according to PartiQL Spec Sections 3.3 and 12.5.
    • 3: I rewrite the query using a Visitor Transform and introduce a Meta to help maintain idempotency. Based on the PartiQL Spec sections mentioned above.

Good Examples

The following queries are supposed to work, and now they do.

SELECT b AS "C"
FROM (
    SELECT a AS b, (-1 * a) AS z
    FROM [ { 'a': 2, 'z': 4 }, { 'a': 1, 'z': 2 }, { 'a': -1, 'z': -2 } ]
    ORDER BY b
)
ORDER BY "C"
====
[
  {
    'C': -1
  },
  {
    'C': 1
  },
  {
    'C': 2
  }
]
--- 
SELECT (a * -1) AS b FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY b;
--- RESULT:
[
  {
    'b': -2
  },
  {
    'b': -1
  }
]
SELECT sum(a) AS c, (a * -1) AS b FROM << { 'a': 1 }, { 'a': 2 } >> GROUP BY a ORDER BY b LIMIT 1;
--- RESULT:
[
  {
    'c': 2,
    'b': -2
  }
]

And, here's a very interesting one that shows what it means to modify the environment's bindings.

SELECT (a * -1) AS a FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY -a;
-- RESULT:
[
  {
    'a': -1
  },
  {
    'a': -2
  }
]
-- We ran !add_to_global_env { 'c': -1 } before the following
SELECT (a * -1) AS a FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY a * c;
-- RESULT:
[
  {
    'a': -1
  },
  {
    'a': -2
  }
]

Bad Examples

The following queries should NOT work, and they do NOT.

SELECT b AS "C"
FROM (
    SELECT a AS b, (-1 * a) AS z
    FROM [ { 'a': 2, 'z': 4 }, { 'a': 1, 'z': 2 }, { 'a': -1, 'z': -2 } ]
    ORDER BY b
)
ORDER BY "c"

This failure shows that the a binding cannot be used in ORDER BY.

SELECT (a * -1) AS b FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY a;

More Information

  • Updated CHANGELOG
  • No backward incompatible changes
  • No external dependencies

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@johnedquinn johnedquinn added the enhancement New feature or request label Sep 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2022

Codecov Report

Base: 81.21% // Head: 81.53% // Increases project coverage by +0.31% 🎉

Coverage data is based on head (4f71b9a) compared to base (74b6cf6).
Patch coverage: 90.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #740      +/-   ##
============================================
+ Coverage     81.21%   81.53%   +0.31%     
- Complexity     2615     2623       +8     
============================================
  Files           257      259       +2     
  Lines         21288    21715     +427     
  Branches       3861     4045     +184     
============================================
+ Hits          17290    17705     +415     
- Misses         2776     2779       +3     
- Partials       1222     1231       +9     
Flag Coverage Δ
CLI 24.08% <ø> (ø)
EXAMPLES 77.19% <ø> (ø)
EXTENSIONS 66.66% <ø> (ø)
LANG 83.41% <90.00%> (+0.30%) ⬆️
PTS ∅ <ø> (∅)
TEST_SCRIPT 80.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ng/src/org/partiql/lang/eval/EvaluatingCompiler.kt 80.27% <ø> (ø)
...g/eval/visitors/OrderBySortSpecVisitorTransform.kt 86.66% <86.66%> (ø)
.../partiql/lang/ast/IsTransformedOrderByAliasMeta.kt 100.00% <100.00%> (ø)
...rg/partiql/lang/eval/visitors/VisitorTransforms.kt 90.90% <100.00%> (+0.90%) ⬆️
...al/visitors/StaticTypeInferenceVisitorTransform.kt 88.55% <0.00%> (+4.63%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@yliuuuu yliuuuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core logic here seems to be evaluating the project thunk and therefore creating a new environment for ORDER BY so that the alias is bind to a value. Perhaps it is possible to rewrite the query before the compilation? Just so there is no need to create a new environment for ORDER BY.
For example:
SELECT a + 1 as b FROM tbl ORDER BY b can be rewritten to SELECT a+1 as b FROM tbl ORDER BY a+1

@johnedquinn
Copy link
Member Author

The core logic here seems to be evaluating the project thunk and therefore creating a new environment for ORDER BY so that the alias is bind to a value. Perhaps it is possible to rewrite the query before the compilation? Just so there is no need to create a new environment for ORDER BY. For example: SELECT a + 1 as b FROM tbl ORDER BY b can be rewritten to SELECT a+1 as b FROM tbl ORDER BY a+1

So, I was thinking about this, and it shouldn't work for specific scenarios. AKA, if we refer to the order of SQL clause evaluations (loosely):

  1. FROM clause
  2. WHERE clause
  3. GROUP BY clause
  4. HAVING clause
  5. SELECT clause
  6. ORDER BY clause

Then, we can assume that the aliases created during SELECT would be immediately usable as bindings for ORDER BY. So, consider the following query:

SELECT (a * -1) AS a FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY a;

From my interpretation, the above query should result in:

<<
  { a: -2 },
  { a: -1 }
>>

So, replacing the RHS of ORDER BY to be:

SELECT (a * -1) AS a FROM << { 'a': 1 }, { 'a': 2 } >> ORDER BY (a * -1);

SHOULD result in:

<<
  { a: -1 },
  { a: -2 }
>>

Because the a on the RHS of ORDER BY is now the new a from the projection (-1, -2), and the tuples will be ordered by their absolute values --> 1, 2.

But the current evaluating compiler has the evaluation order wrong, so your proposal DOES work with the existing compiler, but the compiler is wrong. So, regardless, I really like your comment, because it made me think about this in terms of evaluation logic and relational algebra, and I think I need to modify the order of the thunks rather than do either of our proposals.

FYI, MySQL takes the following query:

SELECT -id AS id1 FROM test ORDER BY -id1;
-- where test is a single-column table with values 1 and 2

and returns:

-1
-2

@yliuuuu
Copy link
Contributor

yliuuuu commented Sep 8, 2022

I see what you mean here.
Based on the content you have written, I suppose that the last query really should be:

-- what your wrote
SELECT -id AS id1 FROM test ORDER BY -id1;
-- what your probably mean
SELECT -id AS id1 FROM test ORDER BY id1;

A similar analogy to consider is "Using SELECT alias in GROUP BY` in pure SQL context.
For example, consider:

SELECT a + 1 as group_key from test GROUP BY b

Here SQL faces the same problem, somehow it needs to know what is b even though GROUP BY get evaluated before SELECT.
Check this DB-Fiddle link to see the example query, notice how the two query plans generated by PostgreSQL are exactly the same.

Now back to the ORDER BY problem, I think the biggest confusion here is that:
Semantically, SQL's ORDER BY get evaluated after SELECT, but PARTIQL's ORDER BY get evaluated before SELECT. See Spec section 12.5 for more detail.

I suspect the spec defined it that way for semantic consistency, but I could be wrong.

If you main concern is the double evaluation (i.e., evaluate order by twice, once during projection and once during ordering), I suspect this problem can be addressed during the query planning.

Consider:

SELECT <expr> as a FROM tbl ORDER BY a
-- <expr> is some expression

I felt like the planer can essentially choose from

-- double evaluation
SELECT <expr> as a FROM tbl ORDER BY <expr>

or

-- double scan
SELECT a from (SELECT <expr> as a FROM tbl) ORDER BY a

Depending on which operation is cheaper.

check this DB-Fiddle Link for ORDER BY evaluation in PostgreSQL.

I could be totally wrong on this, but I am happy to brainstorming more on this topic with you. Hopefully it helps.

@johnedquinn johnedquinn marked this pull request as draft September 9, 2022 18:51
@johnedquinn
Copy link
Member Author

Marking this as a DRAFT until I get some feedback on this PartiQL Spec Discussion

@johnedquinn johnedquinn force-pushed the order-by-alias branch 2 times, most recently from 5d854c9 to 7e3ec1c Compare September 15, 2022 18:28
@johnedquinn johnedquinn marked this pull request as ready for review September 15, 2022 19:44
@johnedquinn
Copy link
Member Author

After the feedback, I updated the PR to rewrite the query.

Copy link
Contributor

@yliuuuu yliuuuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work overall. Just two small nitpick comments.

Comment on lines 72 to 80
class OrderByAliasSupport(val aliases: Map<String, PartiqlAst.Expr>) : VisitorTransformBase() {
override fun transformExprId(node: PartiqlAst.Expr.Id): PartiqlAst.Expr {
val transformedExpr = super.transformExprId(node)
return when (node.case) {
is PartiqlAst.CaseSensitivity.CaseSensitive -> aliases[node.name.text] ?: transformedExpr
else -> aliases[node.name.text.toLowerCase()] ?: aliases[node.name.text.toUpperCase()] ?: transformedExpr
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please elaborate a little more on why do we need another class here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, take the following query:

SELECT (a + b) AS b FROM << {'a': 0, 'b': 1}, {'a': 0, 'b': 1} >> ORDER BY b

Visitor transforms only allow specifying a single behavior per datatype. So, we use "support" classes to essentially deliver multiple types of behavior. AKA, in this scenario, we only want to replace the id in ORDER BY with whatever it is aliased to. Essentially, it helps with limiting the scope of rewriting. We might not necessarily want to rewrite ALL ids that have value b.

So, instead of replacing EVERY instance of id (b) with a lookup, we scope it to ORDER BY. That means the example from above gets rewritten to:

SELECT (a + b) AS b FROM << {'a': 0, 'b': 1}, {'a': 0, 'b': 1} >> ORDER BY (a + b)

and not:

SELECT (a + (a + b)) AS b FROM << {'a': 0, 'b': 1}, {'a': 0, 'b': 1} >> ORDER BY (a + b)

I'm not entirely sure if it would get rewritten exactly like this because off the top of my head IDK the order of evaluation of the visitor transforms, but you get the point. We don't want to rewrite every encounter of b -- we only want to when it is in the sortSpecs of Order By. See transformSortSpec_expr.

Copy link
Contributor

@yliuuuu yliuuuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@johnedquinn johnedquinn merged commit 96de8e7 into main Sep 21, 2022
@mustafaakin mustafaakin mentioned this pull request Sep 22, 2022
lziq added a commit that referenced this pull request Oct 21, 2022
commit 05c1785
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Wed Oct 19 10:11:34 2022 -0700

    Applied comments in PR 822 (#836)

commit 8255a07
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Tue Oct 18 14:15:15 2022 -0700

    Set next dev version (#846)

commit bc4dc47
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Oct 18 13:13:53 2022 -0700

    Bumps partiql-isl-kotlin to 0.2.2 (#845)

commit 55de098
Author: Alan Cai <caialan@amazon.com>
Date:   Mon Oct 17 14:01:40 2022 -0700

    Update conformance test runner skip list with ported `pts` tests (#829)

commit d8bcf1f
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Oct 17 09:15:21 2022 -0700

    v0.8.0 (#844)

    Creates 0.8.0 commit

commit b4b7e1f
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Fri Oct 14 16:52:49 2022 -0700

    Moves partiql-grammar to org.partiql.lang.syntax.antlr so we don't vend a separate jar (#843)

commit 28d960f
Author: yliuuuu <107505258+yliuuuu@users.noreply.github.com>
Date:   Thu Oct 13 16:07:57 2022 -0700

    fix subquery execution (#842)

commit 0b8d14a
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Oct 13 16:04:55 2022 -0700

    Final changes for REPLACE/UPSERT/INSERT EXCLUDED (#831)

    This commit includes the following:
    - Support for INSERT INTO tbl ... ON CONFLICT DO REPLACE EXCLUDED and REPLACE INTO tbl ... evaluation.
    - Support for INSERT INTO tbl ... ON CONFLICT DO UPDATE EXCLUDED logical planning.
       - The reason that evaluation is excluded is b/c the logic is for update evaluation requires implementing merge with existing values which makes it more completed; since it's not part of the related ask (attached issue) we defer the implementation for now
    - Adds parsing support for AS alias for UPSERT INTO and REPLACE INTO statements.

commit 13f622f
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 15:50:06 2022 -0700

    Cleans up SORT and UNPIVOT factories (#839)

commit 17acf86
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 15:47:41 2022 -0700

    Updates changelog (#840)

commit 376bc18
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 14:45:45 2022 -0700

    Adds support for aggregations and grouping to the planner (#821)

commit 8be7a2d
Author: Alan Cai <caialan@amazon.com>
Date:   Wed Oct 12 13:37:59 2022 -0700

    Update README.md following addition of partiql-tests git submodule (#838)

commit 2210658
Merge: 5715a88 9fdc92c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Wed Oct 12 10:40:25 2022 -0700

    Merge pull request #797 from partiql/graph-match-expr

    Switched from MATCH-as-FROM-source to MATCH-as-expression

commit 9fdc92c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Wed Oct 12 10:36:39 2022 -0700

    Cleanup

commit 0dfc9ec
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 11 14:09:36 2022 -0700

    Put back tests from the reverted commit,
    adjusting the success status as appropriate.

commit a7b42bf
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 11 10:58:32 2022 -0700

    Revert "Allow unparethesized MATCH in more places."

    This reverts commit af6f6c3.

    It's hard or impossible to match this grammar addition in the partiql-lang-rust edition of the grammar.

commit 5715a88
Author: Josh Pschorr <josh@pschorr.dev>
Date:   Fri Oct 7 13:41:00 2022 -0700

    Default sort & null spec in evaluator, not parser (#834)

commit af6f6c3
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Oct 6 23:11:09 2022 -0700

    Allow unparethesized MATCH in more places.

commit 9b26e9c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Oct 6 16:00:58 2022 -0700

    Grammar tweaks to not require (and prohibit) parentheses around a pattern with commas.
    Instead, require commas around the whole MATCH expression in this case.

commit 1ce2669
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 4 22:49:22 2022 -0700

    A couple more parsing tests, involving a bare edge pattern -[]->.

commit e552b92
Merge: 02b07cb a9e5a4e
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 4 17:36:45 2022 -0700

    Merge branch 'main' into graph-match-expr.

    Resolved a conflict in
    	lang/src/org/partiql/lang/eval/physical/PhysicalPlanCompilerImpl.kt

commit a9e5a4e
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Tue Oct 4 15:32:00 2022 -0700

    Removed snapshot from version (#828)

commit a0209df
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Oct 3 13:57:55 2022 -0700

    Adds PIVOT to PartiQLPlanner (#817)

commit 9a159a0
Author: yliuuuu <107505258+yliuuuu@users.noreply.github.com>
Date:   Mon Oct 3 10:45:01 2022 -0700

    Adds UNPIVOT operator to PartiQLPlanner (#815)

    * support `unpivot` operator in planner

commit 07f4a27
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Fri Sep 30 17:02:57 2022 -0400

    Adds SORT operator to planner (#793)

commit f80e015
Author: Alan Cai <caialan@amazon.com>
Date:   Wed Sep 28 14:26:35 2022 -0700

    Add Kotlin conformance test runner (#809)

commit 882d7d2
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Sep 27 17:11:55 2022 -0700

    Remove state from planner (#813)

commit a871ba5
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Sep 27 10:42:13 2022 -0700

    Moves partiql-isl-kotlin to a library of partiql-lang-kotlin (#805)

commit cd16bf3
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Mon Sep 26 15:38:08 2022 -0700

    Removed type names from ExprValueType (#808)

commit 2e19331
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Sep 26 08:23:20 2022 -0700

    Renames PhysicalExprToThunkConverter as PhysicalPlanCompiler (#801)

commit 706acd9
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Fri Sep 23 10:03:51 2022 -0700

    Marked TypedOpBehavior.LEGACY as deprecated (#796)

commit 02b07cb
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Fri Sep 23 09:58:05 2022 -0700

    Lint fixes.

commit f29f894
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Sep 22 21:16:56 2022 -0700

    Switched from MATCH-as-FROM-source to MATCH-as-expression.

commit 4b3ec94
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Sun Sep 18 15:34:08 2022 -0700

    Rename AST node graph_match_expr ~~> gpml_pattern, and matchExpr ~~> gpmlPattern in the grammar.

    The new name is a tad more appropriate for the node's contents
    and will be clashing less with the upcoming new expression form graph_match.

commit 58e908d
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Sep 22 15:32:20 2022 -0700

    Add experimental REPLACE/UPSERT INTO (#788)

    * Add experimental REPLACE/UPSERT INTO

    Adding the parsing capability for `REPLACE INTO` and `REPLACE INTO`.
    See the PR and associated Issue for more details.

commit 8bfaf20
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Sep 22 14:38:16 2022 -0700

    Add logical plan support for DO REPLACE EXCLUDED (#792)

commit 96de8e7
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Wed Sep 21 14:45:58 2022 -0700

    Adds projection alias support to ORDER BY clause (#740)

    * Adds projection alias support to ORDER BY clause

commit 001a99b
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Wed Sep 21 12:59:42 2022 -0700

    Add an additional example for ExprFunction (#786)

    * Add an additional example for ExprFunction

    Adds an example for using a custom function for working with elements
    of lists and struct members.

commit 58dd2cb
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Tue Sep 20 15:23:10 2022 -0700

    Refactor stivt code (#791)

commit 74b6cf6
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Mon Sep 19 10:49:12 2022 -0700

    Splits large tests to allow parallelization and speedup in builds (#779)

commit 16ccbc1
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Fri Sep 16 09:52:18 2022 -0700

    Refactor STIVT Code Style (#782)
lziq added a commit that referenced this pull request Oct 21, 2022
commit ebbe6dc
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 20 14:01:00 2022 -0700

    Update ISL to SNAPSHOT (#851)

commit a298d93
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Oct 20 12:13:52 2022 -0700

    Add redaction for INSERT/UPSERT/REPLACE INTO << >> (#850)

    This commit enables statement redaction for INSERT, REPLACE, and UPSERT.

    See the following for more details:
    #849

commit fb4b29f
Merge: 05c1785 8f8d6d9
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Oct 20 10:31:39 2022 -0700

    Merge pull request #847 from partiql/issue-616

    Makes SqlException.errorContext non-nullable, resolving Issue #616.

commit 8f8d6d9
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Wed Oct 19 11:32:54 2022 -0700

    Attempting to fix divergence in the git submodule test/partiql-tests.

commit 05c1785
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Wed Oct 19 10:11:34 2022 -0700

    Applied comments in PR 822 (#836)

commit 89dacc2
Merge: 7ab757c 8255a07
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 18 17:17:22 2022 -0700

    Merge branch 'main' into issue-616

commit 8255a07
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Tue Oct 18 14:15:15 2022 -0700

    Set next dev version (#846)

commit 7ab757c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 18 13:14:43 2022 -0700

    Makes SqlException.errorContext non-nullable, resolving Issue #616.

commit bc4dc47
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Oct 18 13:13:53 2022 -0700

    Bumps partiql-isl-kotlin to 0.2.2 (#845)

commit 55de098
Author: Alan Cai <caialan@amazon.com>
Date:   Mon Oct 17 14:01:40 2022 -0700

    Update conformance test runner skip list with ported `pts` tests (#829)

commit d8bcf1f
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Oct 17 09:15:21 2022 -0700

    v0.8.0 (#844)

    Creates 0.8.0 commit

commit b4b7e1f
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Fri Oct 14 16:52:49 2022 -0700

    Moves partiql-grammar to org.partiql.lang.syntax.antlr so we don't vend a separate jar (#843)

commit 28d960f
Author: yliuuuu <107505258+yliuuuu@users.noreply.github.com>
Date:   Thu Oct 13 16:07:57 2022 -0700

    fix subquery execution (#842)

commit 0b8d14a
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Oct 13 16:04:55 2022 -0700

    Final changes for REPLACE/UPSERT/INSERT EXCLUDED (#831)

    This commit includes the following:
    - Support for INSERT INTO tbl ... ON CONFLICT DO REPLACE EXCLUDED and REPLACE INTO tbl ... evaluation.
    - Support for INSERT INTO tbl ... ON CONFLICT DO UPDATE EXCLUDED logical planning.
       - The reason that evaluation is excluded is b/c the logic is for update evaluation requires implementing merge with existing values which makes it more completed; since it's not part of the related ask (attached issue) we defer the implementation for now
    - Adds parsing support for AS alias for UPSERT INTO and REPLACE INTO statements.

commit 13f622f
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 15:50:06 2022 -0700

    Cleans up SORT and UNPIVOT factories (#839)

commit 17acf86
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 15:47:41 2022 -0700

    Updates changelog (#840)

commit 376bc18
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Thu Oct 13 14:45:45 2022 -0700

    Adds support for aggregations and grouping to the planner (#821)

commit 8be7a2d
Author: Alan Cai <caialan@amazon.com>
Date:   Wed Oct 12 13:37:59 2022 -0700

    Update README.md following addition of partiql-tests git submodule (#838)

commit 2210658
Merge: 5715a88 9fdc92c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Wed Oct 12 10:40:25 2022 -0700

    Merge pull request #797 from partiql/graph-match-expr

    Switched from MATCH-as-FROM-source to MATCH-as-expression

commit 9fdc92c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Wed Oct 12 10:36:39 2022 -0700

    Cleanup

commit 0dfc9ec
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 11 14:09:36 2022 -0700

    Put back tests from the reverted commit,
    adjusting the success status as appropriate.

commit a7b42bf
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 11 10:58:32 2022 -0700

    Revert "Allow unparethesized MATCH in more places."

    This reverts commit af6f6c3.

    It's hard or impossible to match this grammar addition in the partiql-lang-rust edition of the grammar.

commit 5715a88
Author: Josh Pschorr <josh@pschorr.dev>
Date:   Fri Oct 7 13:41:00 2022 -0700

    Default sort & null spec in evaluator, not parser (#834)

commit af6f6c3
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Oct 6 23:11:09 2022 -0700

    Allow unparethesized MATCH in more places.

commit 9b26e9c
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Oct 6 16:00:58 2022 -0700

    Grammar tweaks to not require (and prohibit) parentheses around a pattern with commas.
    Instead, require commas around the whole MATCH expression in this case.

commit 1ce2669
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 4 22:49:22 2022 -0700

    A couple more parsing tests, involving a bare edge pattern -[]->.

commit e552b92
Merge: 02b07cb a9e5a4e
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Tue Oct 4 17:36:45 2022 -0700

    Merge branch 'main' into graph-match-expr.

    Resolved a conflict in
    	lang/src/org/partiql/lang/eval/physical/PhysicalPlanCompilerImpl.kt

commit a9e5a4e
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Tue Oct 4 15:32:00 2022 -0700

    Removed snapshot from version (#828)

commit a0209df
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Oct 3 13:57:55 2022 -0700

    Adds PIVOT to PartiQLPlanner (#817)

commit 9a159a0
Author: yliuuuu <107505258+yliuuuu@users.noreply.github.com>
Date:   Mon Oct 3 10:45:01 2022 -0700

    Adds UNPIVOT operator to PartiQLPlanner (#815)

    * support `unpivot` operator in planner

commit 07f4a27
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Fri Sep 30 17:02:57 2022 -0400

    Adds SORT operator to planner (#793)

commit f80e015
Author: Alan Cai <caialan@amazon.com>
Date:   Wed Sep 28 14:26:35 2022 -0700

    Add Kotlin conformance test runner (#809)

commit 882d7d2
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Sep 27 17:11:55 2022 -0700

    Remove state from planner (#813)

commit a871ba5
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Tue Sep 27 10:42:13 2022 -0700

    Moves partiql-isl-kotlin to a library of partiql-lang-kotlin (#805)

commit cd16bf3
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Mon Sep 26 15:38:08 2022 -0700

    Removed type names from ExprValueType (#808)

commit 2e19331
Author: R. C. Howell <RCHowell@users.noreply.github.com>
Date:   Mon Sep 26 08:23:20 2022 -0700

    Renames PhysicalExprToThunkConverter as PhysicalPlanCompiler (#801)

commit 706acd9
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Fri Sep 23 10:03:51 2022 -0700

    Marked TypedOpBehavior.LEGACY as deprecated (#796)

commit 02b07cb
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Fri Sep 23 09:58:05 2022 -0700

    Lint fixes.

commit f29f894
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Thu Sep 22 21:16:56 2022 -0700

    Switched from MATCH-as-FROM-source to MATCH-as-expression.

commit 4b3ec94
Author: Vladimir Gapeyev <9939945+vgapeyev@users.noreply.github.com>
Date:   Sun Sep 18 15:34:08 2022 -0700

    Rename AST node graph_match_expr ~~> gpml_pattern, and matchExpr ~~> gpmlPattern in the grammar.

    The new name is a tad more appropriate for the node's contents
    and will be clashing less with the upcoming new expression form graph_match.

commit 58e908d
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Sep 22 15:32:20 2022 -0700

    Add experimental REPLACE/UPSERT INTO (#788)

    * Add experimental REPLACE/UPSERT INTO

    Adding the parsing capability for `REPLACE INTO` and `REPLACE INTO`.
    See the PR and associated Issue for more details.

commit 8bfaf20
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Thu Sep 22 14:38:16 2022 -0700

    Add logical plan support for DO REPLACE EXCLUDED (#792)

commit 96de8e7
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Wed Sep 21 14:45:58 2022 -0700

    Adds projection alias support to ORDER BY clause (#740)

    * Adds projection alias support to ORDER BY clause

commit 001a99b
Author: Arash Maymandi <27716912+am357@users.noreply.github.com>
Date:   Wed Sep 21 12:59:42 2022 -0700

    Add an additional example for ExprFunction (#786)

    * Add an additional example for ExprFunction

    Adds an example for using a custom function for working with elements
    of lists and struct members.

commit 58dd2cb
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Tue Sep 20 15:23:10 2022 -0700

    Refactor stivt code (#791)

commit 74b6cf6
Author: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Date:   Mon Sep 19 10:49:12 2022 -0700

    Splits large tests to allow parallelization and speedup in builds (#779)

commit 16ccbc1
Author: lziq <67429381+lziq@users.noreply.github.com>
Date:   Fri Sep 16 09:52:18 2022 -0700

    Refactor STIVT Code Style (#782)
@johnedquinn johnedquinn deleted the order-by-alias branch December 5, 2022 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for using aliases created in select list in GROUP BY and ORDER BY
3 participants