QuesmaOrg / quesma

Programmable database gateway
https://quesma.com/
Other
97 stars 4 forks source link

Add test for "A/B testing" `table_resolver` bug (in case of pattern) #918

Open avelanarius opened 1 week ago

avelanarius commented 1 week ago

A/B testing is turned on in the configuration by specifying two targets: ClickHouse and Elastic (target: [ch, es]). table_resolver correctly handles it for single index case (e.g. logs), but it's not working correctly for the pattern case (e.g. logs*, even if the pattern matches only a single index with A/B testing requested). It fails with:

  Reason:          "Both Elastic and Clickhouse matched.",
  ResolverName:    "searchAcrossConnectors",
  originError:     &errors.errorString{
    s: "index pattern [[logs*]] resolved to both elasticsearch indices: [[logs]] and clickhouse tables: [[logs]]",
  },

Adding a (skipped) test for such case (a proper fix needs some discussion with @nablaone).