Esempio n. 1
0
 def test_single_attribute_with_predicate(self):
     attributes = self.map.project(single_attribute("attr1"),
                                   greater_or_equal("attr1", 4))
     self.assertCountEqual([4], attributes)
Esempio n. 2
0
 def test_project_with_paging_predicate(self):
     with self.assertRaises(AssertionError):
         self.map.project(single_attribute("foo"), paging(true(), 10))
Esempio n. 3
0
 def test_single_attribute(self):
     attributes = self.map.project(single_attribute("attr1"))
     self.assertCountEqual([1, 4], attributes)
Esempio n. 4
0
        "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),
        "MultiAttributeProjection": projection.multi_attribute(
            _sql_string, _sql_string, _sql_string
        ),
        "IdentityProjection": projection.identity(),
    }
)

_SKIP_ON_SERIALIZE = {
    "Character",
    "Float",
    "boolean[]",
    "char[]",
    "double[]",
    "short[]",
    "float[]",
Esempio n. 5
0
    "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),
    "MultiAttributeProjection":
    projection.multi_attribute(_sql_string, _sql_string, _sql_string),
    "IdentityProjection":
    projection.identity(),
})

_SKIP_ON_SERIALIZE = {
    "Character",
    "Float",
    "boolean[]",
    "char[]",
    "double[]",
    "short[]",
    "float[]",
    "int[]",
Esempio n. 6
0
 def test_single_attribute_with_any_operator(self):
     with self.assertRaises(ValueError):
         single_attribute("foo[any]")
Esempio n. 7
0
 def test_single_attribute_with_empty_path(self):
     with self.assertRaises(ValueError):
         single_attribute("")
Esempio n. 8
0
people.put_all({
    1: HazelcastJsonValue({
        "name": "Philip",
        "age": 46
    }),
    2: HazelcastJsonValue({
        "name": "Elizabeth",
        "age": 44
    }),
    3: HazelcastJsonValue({
        "name": "Henry",
        "age": 13
    }),
    4: HazelcastJsonValue({
        "name": "Paige",
        "age": 15
    }),
})

names = people.project(single_attribute("name"))
print("Names of the people are %s." % names)

children_names = people.project(single_attribute("name"),
                                less_or_equal("age", 18))
print("Names of the children are %s." % children_names)

names_and_ages = people.project(multi_attribute("name", "age"))
print("Names and ages of the people are %s." % names_and_ages)

client.shutdown()