diff --git a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEvaluatorTest.kt b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEvaluatorTest.kt index d735fff91..7d4a60cdd 100644 --- a/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEvaluatorTest.kt +++ b/partiql-eval/src/test/kotlin/org/partiql/eval/internal/PartiQLEvaluatorTest.kt @@ -1276,12 +1276,9 @@ class PartiQLEvaluatorTest { @Test // @Disabled fun developmentTest() { - val input = """ - SELECT "" FROM `{'': 1}` - """.trimIndent() val tc = SuccessTestCase( - input = input, + input = "SELECT DISTINCT VALUE t * 100 FROM <<0, 1, 2.0, 3.0>> AS t;", expected = bagValue( int32Value(0), int32Value(100), diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/casts/CastTable.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/casts/CastTable.kt index b72500060..4e50761cf 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/casts/CastTable.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/casts/CastTable.kt @@ -63,6 +63,11 @@ internal class CastTable private constructor( cast(it) } } + graph[PType.VARIANT] = relationships { + PType.codes().map { + cast(it) + } + } graph[PType.DYNAMIC] = relationships { cast(PType.DYNAMIC) PType.codes().filterNot { it == PType.DYNAMIC }.forEach { diff --git a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/Scope.kt b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/Scope.kt index 153efac74..fba88c235 100644 --- a/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/Scope.kt +++ b/partiql-planner/src/main/kotlin/org/partiql/planner/internal/typer/Scope.kt @@ -144,6 +144,7 @@ internal data class Scope( PType.ROW -> this.fields.any { name.matches(it.name) } PType.STRUCT -> null PType.DYNAMIC -> null + PType.VARIANT -> null else -> false } } diff --git a/partiql-spi/src/main/kotlin/org/partiql/errors/TypeCheckException.kt b/partiql-spi/src/main/kotlin/org/partiql/errors/TypeCheckException.kt index 321880a53..965ea23bc 100644 --- a/partiql-spi/src/main/kotlin/org/partiql/errors/TypeCheckException.kt +++ b/partiql-spi/src/main/kotlin/org/partiql/errors/TypeCheckException.kt @@ -10,7 +10,7 @@ public class TypeCheckException(message: String? = null) : RuntimeException(mess /** * This does not provide the stack trace, as this is very expensive in permissive mode. */ - // TODO: Uncomment override fun fillInStackTrace(): Throwable = this + override fun fillInStackTrace(): Throwable = this } /** diff --git a/test/partiql-tests-runner/src/test/resources/config/eval/skip-eval.txt b/test/partiql-tests-runner/src/test/resources/config/eval/skip-eval.txt index 043d99fcd..52d32e5db 100644 --- a/test/partiql-tests-runner/src/test/resources/config/eval/skip-eval.txt +++ b/test/partiql-tests-runner/src/test/resources/config/eval/skip-eval.txt @@ -35,9 +35,6 @@ PERMISSIVE:::SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, di STRICT:::SELECT VALUE { 'col1': col1, 'g': g } FROM simple_1_col_1_group, different_types_per_row GROUP BY col1 GROUP AS g PERMISSIVE:::select fld3,period from t1,t2 where fld1 = 011401 PERMISSIVE:::select fld3,period from t2,t1 where companynr*10 = 37*10 -PERMISSIVE:::undefinedUnqualifiedVariableWithUndefinedVariableBehaviorMissing -PERMISSIVE:::undefinedUnqualifiedVariableIsNullExprWithUndefinedVariableBehaviorMissing -PERMISSIVE:::undefinedUnqualifiedVariableIsMissingExprWithUndefinedVariableBehaviorMissing PERMISSIVE:::MYSQL_SELECT_20 STRICT:::MYSQL_SELECT_20 PERMISSIVE:::MYSQL_SELECT_21 @@ -74,16 +71,9 @@ STRICT:::POSITION string in invalid type STRICT:::BIT_LENGTH invalid type // TODO: Invalid casts. Needed for V1 release. -STRICT:::cast to int invalid target type{value:"`2017T`",target:"TIMESTAMP"} -STRICT:::cast to int invalid target type{value:" `{{\"\"}}` ",target:"CLOB"} -STRICT:::cast to int invalid target type{value:" `{{\"1\"}}` ",target:"CLOB"} -STRICT:::cast to int invalid target type{value:"`{{}}`",target:"BLOB"} STRICT:::cast to int invalid target type{value:"[1, 2]",target:"LIST"} STRICT:::cast to int invalid target type{value:"[1]",target:"LIST"} STRICT:::cast to int invalid target type{value:"[]",target:"LIST"} -STRICT:::cast to int invalid target type{value:"`(1 2)`",target:"SEXP"} -STRICT:::cast to int invalid target type{value:"`(1)`",target:"SEXP"} -STRICT:::cast to int invalid target type{value:"`()`",target:"SEXP"} STRICT:::cast to int invalid target type{value:"{'a': 1}",target:"STRUCT"} STRICT:::cast to int invalid target type{value:"{'a': '12'}",target:"STRUCT"} STRICT:::cast to int invalid target type{value:"{}",target:"STRUCT"} @@ -102,19 +92,13 @@ PERMISSIVE:::Example 6 - Value Coercion not union-compatible STRICT:::Example 6 - Value Coercion not union-compatible // TODO: Operators. Needed for V1 release. -STRICT:::array navigation with wrongly typed array index STRICT:::data type mismatch in comparison expression -STRICT:::data type mismatch in logical expression // TODO: Sexp tests. Needed for V1 release. PERMISSIVE:::projectOfSexp STRICT:::projectOfSexp // TODO: Miscellaneous. Needed for V1 release. -STRICT:::subscript with non-existent variable in lowercase -STRICT:::subscript with non-existent variable in uppercase -STRICT:::repeated field on struct is ambiguous{identifier:"REPEATED",cn:9,bn:"REPEATED"} -STRICT:::repeated field on struct is ambiguous{identifier:" \"repeated\" ",cn:10,bn:"repeated"} STRICT:::invalid extract year from time STRICT:::invalid extract month from time STRICT:::invalid extract day from time