Skip to content

Commit

Permalink
Merge #37465
Browse files Browse the repository at this point in the history
37465: workload: add TPC-DS queries and workload r=yuzefovich a=yuzefovich

Adds TPC-DS queries and a simple workload to run them. The dataset
must be imported manually prior to running the workload. Some
queries need modifications before they can be parsed by CRDB, so
they are disabled.

Addresses: #37436.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed May 16, 2019
2 parents e9cdfdc + c54a228 commit 9ecfb8b
Show file tree
Hide file tree
Showing 9 changed files with 9,866 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/workloadccl/allccl/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
_ "github.com/cockroachdb/cockroach/pkg/workload/rand"
_ "github.com/cockroachdb/cockroach/pkg/workload/sqlsmith"
_ "github.com/cockroachdb/cockroach/pkg/workload/tpcc"
_ "github.com/cockroachdb/cockroach/pkg/workload/tpcds"
_ "github.com/cockroachdb/cockroach/pkg/workload/tpch"
_ "github.com/cockroachdb/cockroach/pkg/workload/ycsb"
)
2 changes: 1 addition & 1 deletion pkg/ccl/workloadccl/allccl/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (

func bigInitialData(meta workload.Meta) bool {
switch meta.Name {
case `tpcc`, `tpch`:
case `tpcc`, `tpch`, `tpcds`:
return true
default:
return false
Expand Down
8 changes: 8 additions & 0 deletions pkg/ccl/workloadccl/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ func ImportFixture(
injectStats bool,
csvServer string,
) (int64, error) {
for _, t := range gen.Tables() {
if t.InitialRows.FillBatch == nil {
return 0, errors.Errorf(
`import fixture is not supported for workload %s`, gen.Meta().Name,
)
}
}

var numNodes int
if err := sqlDB.QueryRow(numNodesQuery).Scan(&numNodes); err != nil {
return 0, err
Expand Down
1 change: 1 addition & 0 deletions pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ func TestLint(t *testing.T) {
filter,
stream.GrepNot(`.*\.lock`),
stream.GrepNot(`^storage\/engine\/rocksdb_error_dict\.go$`),
stream.GrepNot(`^workload/tpcds/tpcds.go$`),
stream.Map(func(s string) string {
return filepath.Join(pkgDir, s)
}),
Expand Down
8 changes: 8 additions & 0 deletions pkg/workload/tpcds/import.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--
-- The TPC-DS database can be restored from backup (only scale factors of 1 and
-- 10 - about 1GB and 10GB respectively - are available at the moment):
--
-- RESTORE DATABASE tpcds FROM 'gs://cockroach-fixtures/workload/tpcds/scalefactor=1/backup';
--
-- The detailed instructions on how to generate the data from scratch can be
-- found on an internal Confluence page.
Loading

0 comments on commit 9ecfb8b

Please sign in to comment.