-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of additional QueryRunner (#1156)
Changing the QueryRunner so that it relies on `clickhouse.LogManagerIFace` instead of `*clickhouse.LogManager`. Having that, we won't need a duplicate of `QueryRunner` in #1119. Caveat: we're adding a that dumb dummy table resolver, but that's way simpler than having a copy of QueryRunner. Lots of LoCs to save here 😉
- Loading branch information
Showing
5 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright Quesma, licensed under the Elastic License 2.0. | ||
// SPDX-License-Identifier: Elastic-2.0 | ||
|
||
package table_resolver | ||
|
||
import ( | ||
mux "quesma_v2/core" | ||
) | ||
|
||
// DummyTableResolver is a dummy implementation of TableResolver to satisfy the QueryRunner and make it be compatible with the v2 api | ||
// thanks to this we can reuse the existing QueryRunner implementation without any changes. | ||
type DummyTableResolver struct{} | ||
|
||
func NewDummyTableResolver() *DummyTableResolver { | ||
return &DummyTableResolver{} | ||
} | ||
|
||
func (t DummyTableResolver) Start() {} | ||
|
||
func (t DummyTableResolver) Stop() {} | ||
|
||
func (t DummyTableResolver) Resolve(_ string, indexPattern string) *mux.Decision { | ||
return &mux.Decision{ | ||
UseConnectors: []mux.ConnectorDecision{ | ||
&mux.ConnectorDecisionClickhouse{ | ||
ClickhouseTableName: indexPattern, | ||
ClickhouseIndexes: []string{indexPattern}, // TODO this won't work for 'common table' feature | ||
//IsCommonTable: false, | ||
}, | ||
}, | ||
} | ||
|
||
} | ||
|
||
func (t DummyTableResolver) Pipelines() []string { return []string{} } | ||
|
||
func (t DummyTableResolver) RecentDecisions() []mux.PatternDecisions { | ||
return []mux.PatternDecisions{} | ||
} |