Example #1
0
 def test_distinct_with_predicate(self):
     self._fill_with_duplicate_values()
     distinct_values = self.map.aggregate(distinct(),
                                          greater_or_equal("this", 10))
     self.assertEqual(set(range(10, 50)), distinct_values)
Example #2
0
 def test_distinct_with_attribute_path(self):
     self._fill_with_duplicate_values()
     distinct_values = self.map.aggregate(distinct("this"))
     self.assertEqual(set(range(50)), distinct_values)
Example #3
0
     predicate.equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.not_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater_or_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
 ),
 "OrPredicate": predicate.or_(
     predicate.sql(_sql_string),
     predicate.equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.not_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater_or_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
 ),
 "InstanceOfPredicate": predicate.instance_of(
     "com.hazelcast.nio.serialization.compatibility.CustomStreamSerializable"
 ),
 "DistinctValuesAggregator": aggregator.distinct(_sql_string),
 "MaxAggregator": aggregator.max_(_sql_string),
 "MaxByAggregator": aggregator.max_by(_sql_string),
 "MinAggregator": aggregator.min_(_sql_string),
 "MinByAggregator": aggregator.min_by(_sql_string),
 "CountAggregator": aggregator.count(_sql_string),
 "NumberAverageAggregator": aggregator.number_avg(_sql_string),
 "IntegerAverageAggregator": aggregator.int_avg(_sql_string),
 "LongAverageAggregator": aggregator.long_avg(_sql_string),
 "DoubleAverageAggregator": aggregator.double_avg(_sql_string),
 "IntegerSumAggregator": aggregator.int_sum(_sql_string),
 "LongSumAggregator": aggregator.long_sum(_sql_string),
 "DoubleSumAggregator": aggregator.double_sum(_sql_string),
 "FixedSumAggregator": aggregator.fixed_point_sum(_sql_string),
 "FloatingPointSumAggregator": aggregator.floating_point_sum(_sql_string),
 "SingleAttributeProjection": projection.single_attribute(_sql_string),
Example #4
0
 def test_distinct(self):
     self._fill_with_duplicate_values()
     distinct_values = self.map.aggregate(distinct())
     self.assertEqual(set(range(50)), distinct_values)
Example #5
0
     predicate.greater_or_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
 ),
 "OrPredicate":
 predicate.or_(
     predicate.sql(_sql_string),
     predicate.equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.not_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater(_sql_string, REFERENCE_OBJECTS["Integer"]),
     predicate.greater_or_equal(_sql_string, REFERENCE_OBJECTS["Integer"]),
 ),
 "InstanceOfPredicate":
 predicate.instance_of(
     "com.hazelcast.nio.serialization.compatibility.CustomStreamSerializable"
 ),
 "DistinctValuesAggregator":
 aggregator.distinct(_sql_string),
 "MaxAggregator":
 aggregator.max_(_sql_string),
 "MaxByAggregator":
 aggregator.max_by(_sql_string),
 "MinAggregator":
 aggregator.min_(_sql_string),
 "MinByAggregator":
 aggregator.min_by(_sql_string),
 "CountAggregator":
 aggregator.count(_sql_string),
 "NumberAverageAggregator":
 aggregator.number_avg(_sql_string),
 "IntegerAverageAggregator":
 aggregator.int_avg(_sql_string),
 "LongAverageAggregator":