File size: 2,032 Bytes
b110593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//                           _       _
// __      _____  __ ___   ___  __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
//  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
//   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
//  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
//
//  CONTACT: [email protected]
//

package traverser

// TODO: do we still need this? there is no more spark support with 0.20.x
// func Test_ParamsHashing(t *testing.T) {
// 	params := func() AggregateParams {
// 		return AggregateParams{
// 			Analytics: filters.AnalyticsProps{UseAnalyticsEngine: true},
// 			ClassName: schema.ClassName("MyBestClass"),
// 			Filters:   nil,
// 			Kind:      kind.Thing,
// 			Properties: []AggregateProperty{
// 				AggregateProperty{
// 					Name:        schema.PropertyName("bestprop"),
// 					Aggregators: []Aggregator{CountAggregator},
// 				},
// 			},
// 		}
// 	}
// 	hash := func() string { return "a71e85e0741fccd63b33281b26270d43" }

// 	t.Run("it generates a hash", func(t *testing.T) {
// 		p := params()
// 		h, err := p.AnalyticsHash()
// 		require.Nil(t, err)
// 		assert.Equal(t, h, hash())
// 	})

// 	t.Run("it generates the same hash if analytical props are changed", func(t *testing.T) {
// 		p := params()
// 		p.Analytics.ForceRecalculate = true
// 		h, err := p.AnalyticsHash()
// 		require.Nil(t, err)
// 		assert.Equal(t, hash(), h)
// 	})

// 	t.Run("it generates a different hash if a prop is changed", func(t *testing.T) {
// 		p := params()
// 		p.Properties[0].Aggregators[0] = MaximumAggregator
// 		h, err := p.AnalyticsHash()
// 		require.Nil(t, err)
// 		assert.NotEqual(t, hash(), h)
// 	})

// 	t.Run("it generates a different hash if where filter is added", func(t *testing.T) {
// 		p := params()
// 		p.Filters = &filters.LocalFilter{Root: &filters.Clause{Value: &filters.Value{Value: "foo"}}}
// 		h, err := p.AnalyticsHash()
// 		require.Nil(t, err)
// 		assert.NotEqual(t, hash(), h)
// 	})
// }