Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller committed Nov 25, 2024
1 parent 70cce2d commit 4cde95e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion admin/provisioner/clickhousestatic/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (p *Provisioner) pingWithResourceDSN(ctx context.Context, dsn string) error

_, err = db.ExecContext(ctx, "SELECT 1")
if err != nil {
return fmt.Errorf("failed to execute query on tenant: %w", err)
return fmt.Errorf("failed to execute query: %w", err)
}

return nil
Expand Down
10 changes: 10 additions & 0 deletions runtime/queries/column_numeric_histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ func (q *ColumnNumericHistogram) calculateFDMethod(ctx context.Context, rt *runt
return fmt.Errorf("not available for dialect %q", olap.Dialect())
}

if olap.Dialect() == drivers.DialectClickHouse {
// Returning early with empty results because this query tends to hang on ClickHouse.
return nil
}

minVal, maxVal, rng, err := getMinMaxRange(ctx, olap, q.ColumnName, q.Database, q.DatabaseSchema, q.TableName, priority)
if err != nil {
return err
Expand Down Expand Up @@ -267,6 +272,11 @@ func (q *ColumnNumericHistogram) calculateDiagnosticMethod(ctx context.Context,
return fmt.Errorf("not available for dialect '%s'", olap.Dialect())
}

if olap.Dialect() == drivers.DialectClickHouse {
// Returning early with empty results because this query tends to hang on ClickHouse.
return nil
}

minVal, maxVal, rng, err := getMinMaxRange(ctx, olap, q.ColumnName, q.Database, q.DatabaseSchema, q.TableName, priority)
if err != nil {
return err
Expand Down
5 changes: 5 additions & 0 deletions runtime/queries/column_rug_histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ func (q *ColumnRugHistogram) Resolve(ctx context.Context, rt *runtime.Runtime, i
return fmt.Errorf("not available for dialect '%s'", olap.Dialect())
}

if olap.Dialect() == drivers.DialectClickHouse {
// Returning early with empty results because this query tends to hang on ClickHouse.
return nil
}

minVal, maxVal, rng, err := getMinMaxRange(ctx, olap, q.ColumnName, q.Database, q.DatabaseSchema, q.TableName, priority)
if err != nil {
return err
Expand Down

0 comments on commit 4cde95e

Please sign in to comment.