Skip to content

Commit

Permalink
do not revert
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 10, 2024
1 parent a3a3321 commit 3fa6b89
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions flow/e2e/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package e2e_clickhouse
import (
"context"
"encoding/binary"
"errors"
"fmt"
"math/big"
"strconv"
Expand Down Expand Up @@ -185,15 +184,10 @@ func (s ClickHouseSuite) GetRows(table string, cols string) (*model.QRecordBatch
}
defer ch.Close()

firstCol, _, _ := strings.Cut(cols, ",")
if firstCol == "" {
return nil, errors.New("no columns specified")
}
batch := &model.QRecordBatch{}
var schema chproto.Results
if err := ch.Do(context.Background(), chgo.Query{
Body: fmt.Sprintf(`SELECT %s FROM %s FINAL WHERE _peerdb_is_deleted = 0 ORDER BY %s SETTINGS use_query_cache = false`,
cols, table, firstCol),
Body: fmt.Sprintf(`SELECT %s FROM %s FINAL WHERE _peerdb_is_deleted = 0 ORDER BY 1 SETTINGS use_query_cache = false`, cols, table),
Result: schema.Auto(),
OnResult: func(ctx context.Context, block chproto.Block) error {
if len(batch.Schema.Fields) == 0 {
Expand Down

0 comments on commit 3fa6b89

Please sign in to comment.