MCPcopy Create free account
hub / github.com/apache/arrow / AnnotateForRandomGeneration

Function AnnotateForRandomGeneration

cpp/src/arrow/compute/row/grouper_test.cc:1067–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065}
1066
1067FieldVector AnnotateForRandomGeneration(FieldVector fields) {
1068 for (auto& field : fields) {
1069 // For each field, constrain random generation to ensure that group ids
1070 // can appear more than once.
1071 if (is_integer(*field->type())) {
1072 field =
1073 field->WithMergedMetadata(key_value_metadata({"min", "max"}, {"100", "10000"}));
1074 } else if (is_binary_like(*field->type())) {
1075 // (note this is unsupported for large binary types)
1076 field = field->WithMergedMetadata(key_value_metadata({"unique"}, {"100"}));
1077 }
1078 field = field->WithMergedMetadata(key_value_metadata({"null_probability"}, {"0.1"}));
1079 }
1080 return fields;
1081}
1082
1083void TestRandomConsume(TestGrouper g) {
1084 // Exercise Consume

Callers 2

TestRandomConsumeFunction · 0.85
TestRandomLookupFunction · 0.85

Calls 5

key_value_metadataFunction · 0.85
is_binary_likeFunction · 0.85
WithMergedMetadataMethod · 0.80
is_integerFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected