Skip to content

Commit

Permalink
Update mockdb to use partiql value schema (#1229)
Browse files Browse the repository at this point in the history
Co-authored-by: John Ed Quinn <[email protected]>
  • Loading branch information
RCHowell and johnedquinn authored Sep 27, 2023
1 parent 882667e commit 8ca2709
Show file tree
Hide file tree
Showing 43 changed files with 836 additions and 646 deletions.
13 changes: 7 additions & 6 deletions partiql-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
implementation(project(":partiql-lang"))
implementation(project(":partiql-plan"))
implementation(project(":partiql-types"))
implementation(project(":plugins:partiql-local"))
implementation(project(":partiql-spi"))
implementation(Deps.csv)
implementation(Deps.awsSdkBom)
Expand Down Expand Up @@ -62,17 +63,17 @@ tasks.register<GradleBuild>("install") {
}

val testingPluginDirectory = "$buildDir/tmp/plugins"
val mockDBPluginDirectory = "$testingPluginDirectory/mockdb"
val mockDBPluginDirectory = "$testingPluginDirectory/local"

tasks.register<Copy>("generateMockDBJAR") {
dependsOn(":plugins:partiql-mockdb:assemble")
from("${rootProject.projectDir}/plugins/partiql-mockdb/build/libs")
tasks.register<Copy>("generateLocalPluginJar") {
dependsOn(":plugins:partiql-local:assemble")
from("${rootProject.projectDir}/plugins/partiql-local/build/libs")
into(mockDBPluginDirectory)
include("partiql-mockdb-*.jar")
include("partiql-local-*.jar")
}

tasks.test.configure {
dependsOn(tasks.findByName("generateMockDBJAR"))
dependsOn(tasks.findByName("generateLocalPluginJar"))
}

tasks.withType<Test>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package org.partiql.coverage.api.impl
internal class ThresholdException internal constructor(
val minimum: Double,
val actual: Double,
val type: ThresholdType
val type: ThresholdType,
) : Exception("PartiQL $type Coverage Minimum set to $minimum, however, $actual was received.", null) {
enum class ThresholdType {
BRANCH,
Expand Down
2 changes: 1 addition & 1 deletion partiql-lang/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
implementation(Deps.csv)
implementation(Deps.kotlinReflect)

testImplementation(project(":plugins:partiql-mockdb"))
testImplementation(project(":plugins:partiql-local"))
testImplementation(project(":lib:isl"))
testImplementation(Deps.assertj)
testImplementation(Deps.junit4)
Expand Down

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions partiql-lang/src/test/resources/catalogs/aws/b/b.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
type: "bag",
items: {
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "identifier",
type: "int",
}
]
}
}
11 changes: 0 additions & 11 deletions partiql-lang/src/test/resources/catalogs/aws/b/b.json

This file was deleted.

13 changes: 13 additions & 0 deletions partiql-lang/src/test/resources/catalogs/aws/ddb/b.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
type: "bag",
items: {
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "identifier",
type: "string",
}
]
}
}
11 changes: 0 additions & 11 deletions partiql-lang/src/test/resources/catalogs/aws/ddb/b.json

This file was deleted.

17 changes: 17 additions & 0 deletions partiql-lang/src/test/resources/catalogs/aws/ddb/pets.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
type: "bag",
items: {
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "id",
type: "int",
},
{
name: "breed",
type: "string",
}
]
}
}
16 changes: 0 additions & 16 deletions partiql-lang/src/test/resources/catalogs/aws/ddb/pets.json

This file was deleted.

23 changes: 23 additions & 0 deletions partiql-lang/src/test/resources/catalogs/b/b/b.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "b",
type: {
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "b",
type: "int",
}
]
}
},
{
name: "c",
type: "int",
}
]
}
22 changes: 0 additions & 22 deletions partiql-lang/src/test/resources/catalogs/b/b/b.json

This file was deleted.

1 change: 1 addition & 0 deletions partiql-lang/src/test/resources/catalogs/b/b/c.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"int"
5 changes: 0 additions & 5 deletions partiql-lang/src/test/resources/catalogs/b/b/c.json

This file was deleted.

22 changes: 22 additions & 0 deletions partiql-lang/src/test/resources/catalogs/b/b/d.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
type: "struct",
constraints: [ ordered ],
fields: [
{
name: "e",
type: "int",
},
{
name: "e",
type: {
type: "struct",
fields: [
{
name: "f",
type: "int",
}
]
}
}
]
}
22 changes: 0 additions & 22 deletions partiql-lang/src/test/resources/catalogs/b/b/d.json

This file was deleted.

1 change: 1 addition & 0 deletions partiql-lang/src/test/resources/catalogs/b/c/c.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"decimal"
5 changes: 0 additions & 5 deletions partiql-lang/src/test/resources/catalogs/b/c/c.json

This file was deleted.

19 changes: 19 additions & 0 deletions partiql-lang/src/test/resources/catalogs/db/markets/order_info.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
name: "order_info",
constraints: [ closed, unique, ordered ],
type: "struct",
fields: [
{
name: "customer_id",
type: "int",
},
{
name: "marketplace_id",
type: "int",
},
{
name: "ship_option",
type: "string",
}
]
}

This file was deleted.

21 changes: 21 additions & 0 deletions partiql-lang/src/test/resources/catalogs/db/markets/orders.ion
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
type: "bag",
items: {
type: "struct",
constraints: [ closed, unique, ordered ],
fields: [
{
name: "customer_id",
type: "int",
},
{
name: "marketplace_id",
type: "int",
},
{
name: "ship_option",
type: "string",
}
]
}
}
21 changes: 0 additions & 21 deletions partiql-lang/src/test/resources/catalogs/db/markets/orders.json

This file was deleted.

Loading

1 comment on commit 8ca2709

@github-actions
Copy link

Choose a reason for hiding this comment

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

JMH Benchmark

Benchmark suite Current: 8ca2709 Previous: 882667e Ratio
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinAggFuncGroupingWithInterruptible 390.55808482872663 us/op 487.62867084721773 us/op 0.80
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinAggFuncGroupingWithoutInterruptible 390.66488410641176 us/op 453.2607954195452 us/op 0.86
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinAggFuncWithInterruptible 353.5289485858306 us/op 386.0249313377153 us/op 0.92
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinAggFuncWithoutInterruptible 343.86389069451513 us/op 397.0928153974564 us/op 0.87
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinWithInterruptible 245.87116260489148 us/op 304.5899668547764 us/op 0.81
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.compileCrossJoinWithoutInterruptible 250.47956005367146 us/op 285.20533620624684 us/op 0.88
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.evalCrossJoinAggWithInterruptible 8568283.782650001 us/op 8690361.57635 us/op 0.99
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.evalCrossJoinAggWithoutInterruptible 8460682.167600002 us/op 9164073.154099999 us/op 0.92
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.evalCrossJoinWithInterruptible 61.03900548459173 us/op 73.98383064850148 us/op 0.83
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.evalCrossJoinWithoutInterruptible 65.23384731591635 us/op 76.96776227095913 us/op 0.85
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.iterCrossJoinAggWithInterruptible 8604439.69875 us/op 8746174.86115 us/op 0.98
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.iterCrossJoinAggWithoutInterruptible 8653789.38215 us/op 8912622.27765 us/op 0.97
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.iterCrossJoinWithInterruptible 141997.61233571428 us/op 156379.27264285716 us/op 0.91
org.partiql.jmh.benchmarks.CompilerInterruptionBenchmark.iterCrossJoinWithoutInterruptible 140471.89018392854 us/op 156542.85562857141 us/op 0.90
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLCompiler15 119.03577659948394 us/op 141.07266849543845 us/op 0.84
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLCompiler30 235.97178902182594 us/op 273.23807334610615 us/op 0.86
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLEvaluator15 555177.043375 us/op 673743.6562749998 us/op 0.82
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLEvaluator30 1101632.8595999999 us/op 1336745.7940999998 us/op 0.82
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLEvaluator30WithData10 9122005.989049999 us/op 12847542.4778 us/op 0.71
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLParser15 192.4246908543341 us/op 225.3487237310525 us/op 0.85
org.partiql.jmh.benchmarks.MultipleLikeBenchmark.testPartiQLParser30 360.18246724997323 us/op 431.1381583071431 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameCaseWhenThen 46.06594262182189 us/op 54.182527991071346 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameComplexQuery 62.376427574274416 us/op 75.26910797143634 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameComplexQuery01 324.99343244357067 us/op 399.2355223581437 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameComplexQuery02 566.4834919970529 us/op 719.708663491821 us/op 0.79
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameExceptUnionIntersectSixty 215.05298990133215 us/op 264.6213678282123 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameExec20Expressions 69.3232476562584 us/op 87.73020865982046 us/op 0.79
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameFromLet 48.812896649800564 us/op 57.70217471722524 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameGraphPattern 48.189512794871106 us/op 57.49362018022523 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameGraphPreFilters 73.8336294383817 us/op 87.41929800437627 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameGroupLimit 51.09046409144559 us/op 61.09123714135717 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameLongFromSourceOrderBy 72.71753406296276 us/op 92.34948134266892 us/op 0.79
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameManyJoins 68.46204829537561 us/op 82.30106301890322 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameNestedAggregates 124.08804115662561 us/op 136.14846071695752 us/op 0.91
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameNestedParen 22.702328214316776 us/op 25.943839906996867 us/op 0.88
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNamePivot 73.69555814616301 us/op 86.66051311353617 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQuery15OrsAndLikes 229.9352550597402 us/op 270.22003639700085 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQuery30Plus 121.705576849209 us/op 144.430457673433 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQueryFunc 57.103456150687656 us/op 68.86225820476997 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQueryFuncInProjection 127.49898050967943 us/op 153.7981067796058 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQueryList 87.93715510629875 us/op 102.97163573426481 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQueryNestedSelect 803.6657194976816 us/op 925.8178641284843 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameQuerySimple 20.193926710896587 us/op 23.155557927431982 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSeveralJoins 27.08044357483022 us/op 31.01257640907148 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSeveralProjections 83.75191474836942 us/op 100.25788443923607 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSeveralSelect 222.2901473451406 us/op 258.7380973631369 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSimpleInsert 34.44888616318284 us/op 44.00010357644399 us/op 0.78
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSomeJoins 26.578134752162327 us/op 31.13291617757086 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSomeProjections 35.81413595744847 us/op 42.00495230194676 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameSomeSelect 58.36790611694346 us/op 70.10069420730974 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameTimeZone 29.41778077556765 us/op 34.22499151944968 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameVeryLongQuery 379.08527778255575 us/op 440.5451214111581 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseFailNameVeryLongQuery01 1090.930756011212 us/op 1348.8508472614253 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameCaseWhenThen 29.65453953013095 us/op 34.248343935633315 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameComplexQuery 251.1364736799892 us/op 313.61176894544064 us/op 0.80
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameComplexQuery01 118.45304815540025 us/op 137.06137204262637 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameExceptUnionIntersectSixty 243.6718156082089 us/op 289.7784166384091 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameExec20Expressions 73.99732911567345 us/op 86.08482163397426 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameFromLet 41.226723813015035 us/op 49.2450420274033 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameGraphPattern 44.776325141345225 us/op 53.92055880402878 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameGraphPreFilters 74.53916572751804 us/op 91.55697578017342 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameGroupLimit 36.47684771196705 us/op 44.09260484126147 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameLongFromSourceOrderBy 142.1780271041034 us/op 177.62093913391612 us/op 0.80
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameManyJoins 48.67876099433931 us/op 57.09833111235314 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameNestedAggregates 102.36450622681257 us/op 118.13330258131245 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameNestedParen 93.78164469897955 us/op 97.94379131848368 us/op 0.96
org.partiql.jmh.benchmarks.ParserBenchmark.parseNamePivot 69.95864287880252 us/op 82.88886342525252 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQuery15OrsAndLikes 190.15928450107873 us/op 219.40944205123606 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQuery30Plus 70.4885831524505 us/op 79.15611582497684 us/op 0.89
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQueryFunc 141.2148420503759 us/op 174.71071231465052 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQueryFuncInProjection 102.47099577353319 us/op 123.50935752616711 us/op 0.83
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQueryList 85.74489404802122 us/op 105.59036530615337 us/op 0.81
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQueryNestedSelect 143.43585915137317 us/op 167.88683470273867 us/op 0.85
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameQuerySimple 14.772026612388341 us/op 17.176414992702426 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSeveralJoins 82.47191997380162 us/op 93.96541428875395 us/op 0.88
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSeveralProjections 62.08934581229907 us/op 69.18682197518845 us/op 0.90
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSeveralSelect 124.60950564084867 us/op 142.12591971177022 us/op 0.88
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSimpleInsert 25.447702904975397 us/op 28.779649131669384 us/op 0.88
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSomeJoins 23.69910548329437 us/op 27.481491300567065 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSomeProjections 22.230946069526208 us/op 24.005928738431418 us/op 0.93
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameSomeSelect 39.202718758907196 us/op 45.5732936974052 us/op 0.86
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameTimeZone 10.548011209563771 us/op 12.177449512545824 us/op 0.87
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameVeryLongQuery 453.9836592719401 us/op 543.1563229739774 us/op 0.84
org.partiql.jmh.benchmarks.ParserBenchmark.parseNameVeryLongQuery01 1307.3678313271073 us/op 1535.4455330015758 us/op 0.85
org.partiql.jmh.benchmarks.PartiQLBenchmark.testPartiQLCompiler 9.996539706209228 us/op 13.364220142950298 us/op 0.75
org.partiql.jmh.benchmarks.PartiQLBenchmark.testPartiQLEvaluator 2.766411238166711 us/op 3.2508226432598972 us/op 0.85
org.partiql.jmh.benchmarks.PartiQLBenchmark.testPartiQLParser 13.328003730606175 us/op 15.294298675897204 us/op 0.87

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.