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

Fixes several tests #122

Closed
wants to merge 1 commit into from
Closed

Fixes several tests #122

wants to merge 1 commit into from

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Aug 8, 2024

Description

In the below sections, I'll elaborate on the tests fixed.

Fixes FROM Mistyping Cases

In the following cases the expression in the FROM clause item has the wrong type. Under the type checking option, all of these cases raise an error and the query fails. Under the permissive option, the cases proceed as follows:
Iteration over a scalar value: Consider the query:
FROM s AS v AT p
or the query:
FROM s AS v
where s is a scalar value. Then s coerces into the bag << s >>, i.e., the bag that has a single element, the s. The
rest of the semantics is identical to what happens when the lhs of the FROM item is a bag.

-- PartiQL Specification Section 5.1.1

Fixes UNPIVOT Mistyping Cases

In the following cases the expression in the FROM UNPIVOT clause item has the “wrong” type, i.e., it is not a tuple. Under the type checking option, all of these cases raise an error and the query fails. Under the permissive option, the cases proceed as follows:
...

-- PartiQL Specification Section 5.2.1

Fixes undefined variable tests

Similarly, for a given 𝑞 at compile (i.e. planning) time, a database type environment... and variables type environment ... are defined. The type environment is a binding tuple ... where each 𝑥𝑖 is a name that is unique and binds to the PartiQL type𝜏𝑖. For schema-less values, 𝜏 can be considered the union of any possible type (for which all operations are potentially applicable).

-- PartiQL Specification Section 3.2

Fixes Join Null Output Cases

For example, LEFT JOIN should make the RHS null if the LHS is not matched.

Fixes Outer Union Mistyping Cases

See partiql/partiql-lang#76

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

Fixes FROM/UNPIVOT mistyping cases

Fixes undefined variable tests
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.

1 participant