Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 362eed8

Browse files
authored
Remove string specific array transfomer (#956)
We can remove that `string` specific transformer. We've got a generic solution already. Before: Clickhouse on the left. <img width="1051" alt="before" src="https://github.com/user-attachments/assets/e1846b40-51d8-47b3-ba89-b9873ef1738a"> <img width="1673" alt="dashboard-before" src="https://github.com/user-attachments/assets/00108e56-f82b-469d-a201-4aea1caf742b"> After: Clickhouse on the left. <img width="909" alt="after" src="https://github.com/user-attachments/assets/afa766ec-8b08-4b32-a69c-07790101a18e"> <img width="1660" alt="dashboard-after" src="https://github.com/user-attachments/assets/1ebd6e66-77b2-48bb-b7b6-99a383f70a79">
1 parent 686e2f5 commit 362eed8

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

quesma/quesma/schema_transformer.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -789,28 +789,3 @@ func (s *SchemaCheckPass) Transform(queries []*model.Query) ([]*model.Query, err
789789
}
790790
return queries, nil
791791
}
792-
793-
// ArrayResultTransformer is a transformer that transforms array columns into string representation
794-
type ArrayResultTransformer struct {
795-
}
796-
797-
func (g *ArrayResultTransformer) Transform(result [][]model.QueryResultRow) ([][]model.QueryResultRow, error) {
798-
799-
for i, rows := range result {
800-
801-
for j, row := range rows {
802-
for k, col := range row.Cols {
803-
804-
if ary, ok := col.Value.([]string); ok {
805-
aryStr := make([]string, 0, len(ary))
806-
for _, el := range ary {
807-
aryStr = append(aryStr, fmt.Sprintf("%v", el))
808-
}
809-
result[i][j].Cols[k].Value = fmt.Sprintf("[%s]", strings.Join(aryStr, ","))
810-
}
811-
}
812-
}
813-
814-
}
815-
return result, nil
816-
}

quesma/quesma/search.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ func (q *QueryRunner) postProcessResults(plan *model.ExecutionPlan, results [][]
812812
transformer model.ResultTransformer
813813
}{
814814
{"replaceColumNamesWithFieldNames", &replaceColumNamesWithFieldNames{indexSchema: indexSchema}},
815-
{"arrayResultTransformer", &ArrayResultTransformer{}},
816815
}
817816

818817
var err error

0 commit comments

Comments
 (0)