From d57551464c43611f643facb2a046691716f545a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Strzali=C5=84ski?= Date: Fri, 10 May 2024 15:50:20 +0200 Subject: [PATCH] fix column order --- quesma/clickhouse/quesma_communicator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quesma/clickhouse/quesma_communicator.go b/quesma/clickhouse/quesma_communicator.go index 7acf63e5c..f4808c1ec 100644 --- a/quesma/clickhouse/quesma_communicator.go +++ b/quesma/clickhouse/quesma_communicator.go @@ -42,12 +42,13 @@ func (lm *LogManager) GetAllColumns(table *Table, query *model.Query) []string { // we have to extract again different parts like where clause and columns to build a proper result func (lm *LogManager) ProcessQuery(ctx context.Context, table *Table, query *model.Query, columns []string) ([]model.QueryResultRow, error) { colNames, err := table.extractColumns(query, false) + rowToScan := make([]interface{}, len(colNames)+len(query.NonSchemaFields)) if err != nil { return nil, err } - rows, err := executeQuery(ctx, lm, table.Name, query.StringFromColumns(colNames), columns, rowToScan) + rows, err := executeQuery(ctx, lm, table.Name, query.StringFromColumns(colNames), colNames, rowToScan) if err == nil { for _, row := range rows { row.Index = table.Name