Skip to content

Conversation

@hlgp
Copy link
Collaborator

@hlgp hlgp commented Apr 30, 2025

Requires #2885

<property name="edgeAttribute2" value="NAME"/>
<property name="edgeAttribute3" value="ID"/>
<property name="activityDateField" value = "PREMIERED"/>
<property name="allowedTypeCategories">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want separate allowed type categories for the source and the sink ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would let the bidirectional config dictate that.

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.accumulo.core.util.Pair;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were trying to avoid using this class, maybe replace with apache common's Pair?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, right. slipped my mind

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractMap.SimplEntry is also a fine replacement.

long futureDelta, pastDelta;
long newFormatStartDate;

protected List<datawave.data.type.Type.Category> allowedCategories = Lists.newArrayList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to see a static import for Type.Category

RawRecordContainer myEvent = getEvent(conf);

EdgeHandlerTestUtil.processEvent(fields, edgeHandler, myEvent, 0, true, false);
Assert.assertEquals(expectedKeys, EdgeHandlerTestUtil.edgeKeyResults.keySet());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test is demonstrating that no edge keys are produced I would rename the method and rewrite the assertions to be clear. Someone who isn't familiar with this code like myself might wonder what edges are produced when the preconditions belong to different groups, see that we create a set of expected keys, and then go looking for where we updated the expected collection.

Copy link
Collaborator Author

@hlgp hlgp May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"// test edge config only allows FULL category. LIST_ELEMENTS edges should not be produced in this case"

No problem renaming the test. When I hit these in other MRs I usually expand the rest of the Test class to see what is unaffected and other cases currently handled.

"When the preconditions belong to different groups" ? Not sure what you mean there. You have one precondition per edge, each edge is aware or unaware of the group, and the fields belong to different groups or the same group. The test names try to indicate which combination of attributes
is being tested, which, I agree, is not intuitive.
e.g.,

// geo
for (String normalized : ((OneToManyNormalizerType<Geometry>) geoType).normalizeToMany("POINT(10 10)")) {
for (String normalized : ((OneToManyNormalizerType<Geometry>) geoType).normalizeToMany("POINT(10 10)").stream()
.map(org.apache.accumulo.core.util.Pair::getFirst).collect(Collectors.toList())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use apache common's Pair and use static import

hlgp and others added 8 commits May 16, 2025 17:11
Conflicts:
	core/utils/type-utils/src/main/java/datawave/data/normalizer/OneToManyNormalizer.java
	core/utils/type-utils/src/main/java/datawave/data/type/GeometryType.java
	core/utils/type-utils/src/main/java/datawave/data/type/ListType.java
	core/utils/type-utils/src/main/java/datawave/data/type/OneToManyNormalizerType.java
	core/utils/type-utils/src/test/java/datawave/data/type/ListTypeTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants