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 Type Checking and Inference Assertions and TypeEnv #109

Open
am357 opened this issue Aug 9, 2023 · 0 comments
Open

Add Type Checking and Inference Assertions and TypeEnv #109

am357 opened this issue Aug 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@am357
Copy link
Contributor

am357 commented Aug 9, 2023

Background

The current tests' data model has the following assertions:

type::{
    name: Assertion,
    type: {
        one_of: [
            SyntaxSuccessAssertion,
            SyntaxFailAssertion,
            StaticAnalysisFailAssertion,
            EvaluationSuccessAssertion,
            EvaluationFailAssertion
        ]
    }
}

In addition, the current model does not support the typing environment to be used for type checking and inference.

On the other side, in partiql-lang-kotlin we have unit tests [1] [2] [3] for type checking and inference. In addition, we also have newer unit-tests [4] as part of PartiQLSchemaInferencer development that assert the correct type checking of PartiQL queries resulting to a StaticType as the output Schema. In addition, in partiql-lang-rust, we are introducing type checking and inference functionality [5] which will require the corresponding tests.

Ask

As PartiQL maintainer I want to have the required partiql-tests assertions for type checking and inference so that I can do the following: (1) write appropriate conformance tests for type checking and inference, and (2) extract the current unit-tests in partiql-lang-kotlin.

DoD

  1. The model for assertions and typing environment is created.
  2. As part of a separate GitHub issue related to this issue, the initial tests are ported from partiql-lang-kotlin are ported to partiql-tests.
  3. As part of a separate GitHub issue related to this issue, the conformance test generators in PartiQL Kotlin and Rust implementations can generate the corresponding tests and make assertions based on them.

[1] https://github.com/partiql/partiql-lang-kotlin/blob/c5809251b24057306aff5e0fb6d433f93011bdd0/partiql-lang/src/test/kotlin/org/partiql/lang/ast/passes/inference/StaticTypeCastTests.kt

[2] https://github.com/partiql/partiql-lang-kotlin/blob/main/partiql-lang/src/test/kotlin/org/partiql/lang/eval/visitors/StaticTypeVisitorTransformTests.kt

[3] https://github.com/partiql/partiql-lang-kotlin/blob/main/partiql-lang/src/test/kotlin/org/partiql/lang/eval/visitors/StaticTypeInferenceVisitorTransformTest.kt

[4] https://github.com/partiql/partiql-lang-kotlin/blob/main/partiql-lang/src/test/kotlin/org/partiql/lang/planner/transforms/PartiQLSchemaInferencerTests.kt

[5] partiql/partiql-lang-rust#399

@am357 am357 changed the title Add Type Checking and Inference Assertions Add Type Checking and Inference Assertions and TypeEnv Aug 9, 2023
@am357 am357 added the enhancement New feature or request label Aug 9, 2023
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

No branches or pull requests

1 participant