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

Make ThunkFactory generic #587

Merged
merged 13 commits into from
May 10, 2022
Merged

Conversation

dlurton
Copy link
Member

@dlurton dlurton commented Apr 29, 2022

Originally part of #582, this PR is based on #584 (which must be merged first).

The legacy AST evaluator's ThunkFactory and related types were tightly coupled to the org.partiql.lang.eval.Environment class. However, the new plan evaluator replaces this class with a different one. This PR makes ThunkFactory and related types generic so that a different environment class may be used with the physical plan evaluator without having to duplicate ThunkFactory et al.

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

@dlurton dlurton force-pushed the physical-plan-staging-thunk branch from 57641ab to afce4bc Compare April 29, 2022 22:07
@dlurton dlurton mentioned this pull request Apr 29, 2022
Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

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

Changes to ThunkFactory and its uses seem reasonable to me. Left some minor comments related to documentation that needs updated due to this change.

@@ -28,8 +28,10 @@ import org.partiql.lang.errors.Property
* See https://en.wikipedia.org/wiki/Thunk
*
* This name was chosen because it is a thunk that accepts an instance of `Environment`.
Copy link
Member

Choose a reason for hiding this comment

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

Comment may need updated since Environment was made generic. Similarly on L41.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I can probably just delete these lines--I don't think they added much.

lang/src/org/partiql/lang/eval/Thunk.kt Show resolved Hide resolved
lang/src/org/partiql/lang/eval/Thunk.kt Show resolved Hide resolved
@@ -43,10 +44,11 @@ import org.partiql.lang.errors.UNKNOWN
open class SqlException(
override var message: String,
val errorCode: ErrorCode,
val errorContext: PropertyValueMap? = null,
errorContextArg: PropertyValueMap? = null,
Copy link
Member

Choose a reason for hiding this comment

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

kdoc for this parameter needs to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

Base automatically changed from physical-plan-staging-pig-domains to physical-plan-staging May 10, 2022 17:21
@dlurton dlurton requested a review from alancai98 May 10, 2022 18:00
Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

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

Changes since last commit look good other than the one comment in EvaluatingCompilerOffsetTests.kt.

tc.copy(excludeLegacySerializerAssertions = true),
tc.copy(
excludeLegacySerializerAssertions = true,
targetPipeline = EvaluatorTestTarget.COMPILER_PIPELINE, // planner & phys. alg. have no support for OFFSET (yet)
Copy link
Member

Choose a reason for hiding this comment

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

From your comment in the PR that set the test exclusions, #586, you left a comment saying that this comment was wrong. Perhaps there was some missed commit in the merge?

(The original version was just tc.copy(excludeLegacySerializerAssertions = true) and the exclusions were set by the individual EvaluatorTestCases.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, yeah, it must have returned after a merge. Will fix. Thanks.

@dlurton dlurton requested a review from alancai98 May 10, 2022 22:14
Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

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

:shipit:

@dlurton dlurton merged commit ec7d390 into physical-plan-staging May 10, 2022
@dlurton dlurton deleted the physical-plan-staging-thunk branch May 10, 2022 22:26
dlurton added a commit that referenced this pull request May 27, 2022
Merges the following PRs to `main`:

- #583 
- #584 
- #587 
- #588 
- #589 
- #609 
- #590 
- #592 

Also, this adds a TODO comment (ea40e4a, requested by @am357 in offline chat) and excludes `PlannerPipeline` from the new aggregate tests which were pulled in when merging from `main` and were not part of the other PRs (34025b3).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
RCHowell pushed a commit that referenced this pull request Jun 1, 2022
Merges the following PRs to `main`:

- #583 
- #584 
- #587 
- #588 
- #589 
- #609 
- #590 
- #592 

Also, this adds a TODO comment (ea40e4a, requested by @am357 in offline chat) and excludes `PlannerPipeline` from the new aggregate tests which were pulled in when merging from `main` and were not part of the other PRs (34025b3).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
RCHowell pushed a commit that referenced this pull request Jun 1, 2022
Merges the following PRs to `main`:

- #583 
- #584 
- #587 
- #588 
- #589 
- #609 
- #590 
- #592 

Also, this adds a TODO comment (ea40e4a, requested by @am357 in offline chat) and excludes `PlannerPipeline` from the new aggregate tests which were pulled in when merging from `main` and were not part of the other PRs (34025b3).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
RCHowell pushed a commit that referenced this pull request Jun 1, 2022
Merges the following PRs to `main`:

- #583 
- #584 
- #587 
- #588 
- #589 
- #609 
- #590 
- #592 

Also, this adds a TODO comment (ea40e4a, requested by @am357 in offline chat) and excludes `PlannerPipeline` from the new aggregate tests which were pulled in when merging from `main` and were not part of the other PRs (34025b3).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants