Skip to content

Commit

Permalink
Removing no longer needed functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelewski committed May 17, 2024
1 parent cc492d1 commit 5a88997
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions quesma/quesma/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,51 +508,6 @@ func (q *QueryRunner) makeBasicQuery(ctx context.Context,
return fullQuery, columns
}

func (q *QueryRunner) searchWorkerCommon(
ctx context.Context,
queries []model.Query,
columns [][]string,
table *clickhouse.Table,
doPostProcessing bool,
optAsync *AsyncQuery) (translatedQueryBody []byte, hits [][]model.QueryResultRow) {

if optAsync != nil && q.reachedQueriesLimit(ctx, optAsync.asyncRequestIdStr, optAsync.doneCh) {
return
}

var err error
sqls := ""
var dbQueryCtx context.Context
if optAsync != nil {
var dbCancel context.CancelFunc
dbQueryCtx, dbCancel = context.WithCancel(context.Background())
q.addAsyncQueryContext(dbQueryCtx, dbCancel, optAsync.asyncRequestIdStr)
} else {
dbQueryCtx = ctx
}
columnsIndex := 0
for _, query := range queries {
if query.NoDBQuery {
logger.InfoWithCtx(ctx).Msgf("pipeline query: %+v", query)
} else {
logger.InfoWithCtx(ctx).Msgf("SQL: %s", query.String())
sqls += query.String() + "\n"
}
rows, err := q.logManager.ProcessQuery(dbQueryCtx, table, &query, columns[columnsIndex])
if err != nil {
logger.ErrorWithCtx(ctx).Msg(err.Error())
continue
}
hits = append(hits, rows)
columnsIndex++
}
translatedQueryBody = []byte(sqls)
if err != nil {
logger.ErrorWithCtx(ctx).Msgf("Rows: %+v, err: %+v", hits, err)
}
return
}

func (q *QueryRunner) searchAggregationWorkerCommon(
ctx context.Context,
queries []model.Query,
Expand Down Expand Up @@ -599,24 +554,6 @@ func (q *QueryRunner) searchAggregationWorkerCommon(
return
}

func (q *QueryRunner) searchWorker(ctx context.Context,
fullQuery []model.Query,
columns [][]string,
table *clickhouse.Table,
doPostProcessing bool,
optAsync *AsyncQuery) (translatedQueryBody []byte, hits [][]model.QueryResultRow) {
if optAsync == nil {
return q.searchWorkerCommon(ctx, fullQuery, columns, table, doPostProcessing, nil)
} else {
select {
case <-q.executionCtx.Done():
return
default:
return q.searchWorkerCommon(ctx, fullQuery, columns, table, doPostProcessing, optAsync)
}
}
}

func (q *QueryRunner) searchAggregationWorker(ctx context.Context,
aggregations []model.Query,
columns [][]string,
Expand Down

0 comments on commit 5a88997

Please sign in to comment.