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

Add EvalMode to evaluation test assertion #29

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Add EvalMode to evaluation test assertion #29

merged 2 commits into from
Aug 17, 2022

Conversation

alancai98
Copy link
Member

Issue #, if available: partiql/partiql-docs#25

Adds the EvalMode option to the evaluation test schema to represent the different dynamic type mismatch behaviors specified in the PartiQL specification (see section 4.1).

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

@alancai98 alancai98 self-assigned this Aug 16, 2022
Comment on lines -124 to -125
- [optional] evaluation `options` other than the defaults - struct
- e.g. typing mode - strict vs permissive (permissive may be most useful)
Copy link
Member Author

@alancai98 alancai98 Aug 16, 2022

Choose a reason for hiding this comment

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

This was originally a struct to follow all the different compile options specified in the Kotlin reference implementation (see CompileOptions.kt). After looking at the Kotlin implementation's options and the specification, determined that "typing mode" (renamed to evaluation mode) was important to define at this time. Future options (if needed) can be added later.

@@ -107,7 +122,8 @@ type::{
type: struct,
fields: {
result: { type: symbol, valid_values: [EvaluationSuccess], occurs: required },
output: { occurs: required }
output: { occurs: required },
Copy link
Member Author

@alancai98 alancai98 Aug 16, 2022

Choose a reason for hiding this comment

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

I considered modeling the evaluation output's value as the result for EvaluationSuccess cases but this made the schema validation a lot more complicated. The result field has been a symbol and allowing it to take output's value (i.e. any Ion value) can result in a duplicate matching type with EvaluationFail. So I chose to keep the output field separate.

Comment on lines 217 to 218
conformance tests, we will refer to permissive mode as `EvalModeCoerce` and type checking mode as `EvalModeError`.
These names can be changed in the future once we improve the terminology in the specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it makes sense to have a TODO issue in partiql-docs for any required spec. change (like a spike) and linking it 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.

Yeah, I think it makes sense to add. Created https://github.com/partiql/partiql-docs/issues/24 to track and added a link.

Copy link
Contributor

@am357 am357 left a comment

Choose a reason for hiding this comment

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

Thanks adding the issue—LGTM.

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.

3 participants