Skip to content

Commit

Permalink
Remove aggregation spec and Table Aggregation property - default to…
Browse files Browse the repository at this point in the history
… merging child connection schemas. #453
  • Loading branch information
kaidaguerre authored Feb 22, 2023
1 parent b4417d8 commit 4f51ef5
Show file tree
Hide file tree
Showing 17 changed files with 544 additions and 1,244 deletions.
7 changes: 0 additions & 7 deletions grpc/proto/column_definition.go

This file was deleted.

22 changes: 0 additions & 22 deletions grpc/proto/connection_config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package proto

import (
"github.com/gertd/wild"
"github.com/turbot/go-kit/helpers"
)

Expand All @@ -10,24 +9,11 @@ func (x *ConnectionConfig) Equals(other *ConnectionConfig) bool {
x.Plugin == other.Plugin &&
x.PluginShortName == other.PluginShortName &&
x.Config == other.Config &&
x.TableAggregationSpecsEqual(other) &&
x.childConnectionsEqual(other)

return res
}

func (x *ConnectionConfig) TableAggregationSpecsEqual(other *ConnectionConfig) bool {
if len(x.TableAggregationSpecs) != len(other.TableAggregationSpecs) {
return false
}
for i, s := range x.TableAggregationSpecs {
if !other.TableAggregationSpecs[i].Equals(s) {
return false
}
}
return true
}

func (x *ConnectionConfig) childConnectionsEqual(other *ConnectionConfig) bool {
if len(x.ChildConnections) != len(other.ChildConnections) {
return false
Expand All @@ -41,11 +27,3 @@ func (x *ConnectionConfig) childConnectionsEqual(other *ConnectionConfig) bool {
}
return true
}
func (x *ConnectionConfig) GetAggregationSpecForTable(tableName string) *TableAggregationSpec {
for _, spec := range x.TableAggregationSpecs {
if wild.Match(spec.Match, tableName, false) {
return spec
}
}
return nil
}
Loading

0 comments on commit 4f51ef5

Please sign in to comment.