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

Query cache interface implementation for timeseries & metrics views #1446

Merged
merged 30 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7f1700b
queries-caching-impl
Dec 6, 2022
c133a22
queries-caching-impl
Dec 6, 2022
3126c35
caching for time grain query
Dec 6, 2022
eda43c1
caching: column numeric histogram
Dec 6, 2022
c680489
caching: column numeric histogram
Dec 6, 2022
235356f
Merge remote-tracking branch 'origin/main' into query-cache-interface…
Dec 6, 2022
7d095d3
caching: table cardinality fix
Dec 7, 2022
4d6a455
caching: rug histogram
Dec 7, 2022
3895bf1
caching: time range
Dec 7, 2022
c9b94ac
caching: time range
Dec 7, 2022
5d93116
caching: column cardinality
Dec 8, 2022
b4d6095
caching: rollup interval
Dec 8, 2022
0670dec
caching: column with all nulls
Dec 8, 2022
d34946b
caching: code style
Dec 9, 2022
7822a6a
caching: rug
Dec 9, 2022
5f45640
caching: code style
Dec 13, 2022
8923aab
caching: ts fix
Dec 13, 2022
0d8f659
Merge remote-tracking branch 'origin/main' into query-cache-interface…
Dec 13, 2022
5c94aa9
caching: ts fix
Dec 13, 2022
fd3d586
caching: ts fix
Dec 13, 2022
3750567
caching: code style
Dec 14, 2022
c69f7fd
Merge remote-tracking branch 'origin/main' into query-cache-interface…
Dec 14, 2022
1f0f02f
caching: timeseries
Dec 14, 2022
954d9ad
Merge remote-tracking branch 'origin/main' into query-cache-interface…
Dec 14, 2022
7c33d50
caching: table columns
Dec 15, 2022
3387238
caching: metricsview totals
Dec 15, 2022
b8c3bad
caching: metricsview toplist
Dec 15, 2022
0e89a64
caching: metricsview toplist
Dec 15, 2022
40c7c27
caching: metricsview timeseries
Dec 15, 2022
8330ae1
caching: metricsview timeseries
Dec 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/connectors/connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type SamplePolicy struct {
func (s *Source) Validate() error {
connector, ok := Connectors[s.Connector]
if !ok {
return fmt.Errorf("connector: not found")
return fmt.Errorf("connector: not found " + s.Connector)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider doing return fmt.Errorf("connector: not found %q", s.Connector) (will insert value in quotes, so empty strings are clearer in output)

}

for _, propSchema := range connector.Spec().Properties {
Expand Down
50 changes: 50 additions & 0 deletions runtime/queries/column_api_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"

runtimev1 "github.com/rilldata/rill/proto/gen/rill/runtime/v1"
_ "github.com/rilldata/rill/runtime/drivers/duckdb"
"github.com/rilldata/rill/runtime/testruntime"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -106,3 +107,52 @@ func BenchmarkColumnCardinality(b *testing.B) {
require.NotEmpty(b, q.Result)
}
}

func BenchmarkColumnTimeseries(b *testing.B) {
rt, instanceID := testruntime.NewInstanceForProject(b, "ad_bids")
b.ResetTimer()
for i := 0; i < b.N; i++ {
q := &ColumnTimeseries{
TableName: "ad_bids",
TimestampColumnName: "timestamp",
Measures: []*runtimev1.GenerateTimeSeriesRequest_BasicMeasure{
{
Expression: "avg(bid_price)",
SqlName: "avg_bid_price",
},
{
Expression: "count(*)",
SqlName: "count",
},
},
}
err := q.Resolve(context.Background(), rt, instanceID, 0)
require.NoError(b, err)
require.NotEmpty(b, q.Result)
}
}

func BenchmarkColumnTimeseriesSpark(b *testing.B) {
rt, instanceID := testruntime.NewInstanceForProject(b, "ad_bids")
b.ResetTimer()
for i := 0; i < b.N; i++ {
q := &ColumnTimeseries{
TableName: "ad_bids",
TimestampColumnName: "timestamp",
Measures: []*runtimev1.GenerateTimeSeriesRequest_BasicMeasure{
{
Expression: "avg(bid_price)",
SqlName: "avg_bid_price",
},
{
Expression: "count(*)",
SqlName: "count",
},
},
Pixels: 100,
}
err := q.Resolve(context.Background(), rt, instanceID, 0)
require.NoError(b, err)
require.NotEmpty(b, q.Result)
}
}
Loading