MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / rows_equal_by_identity

Method rows_equal_by_identity

graphlite/src/exec/executor.rs:9506–9525  ·  view source on GitHub ↗

Compare rows based on their graph entity identities This is the correct approach for set operations on graph data

(&self, row1: &Row, row2: &Row)

Source from the content-addressed store, hash-verified

9504 /// Compare rows based on their graph entity identities
9505 /// This is the correct approach for set operations on graph data
9506 fn rows_equal_by_identity(&self, row1: &Row, row2: &Row) -> bool {
9507 // If no entities are tracked in either row, fall back to value comparison
9508 if row1.source_entities.is_empty() || row2.source_entities.is_empty() {
9509 return self.rows_equal_by_values(row1, row2);
9510 }
9511
9512 // Check if all tracked entities match
9513 if row1.source_entities.len() != row2.source_entities.len() {
9514 return false;
9515 }
9516
9517 // All entities must match
9518 for (var, entity1) in &row1.source_entities {
9519 match row2.source_entities.get(var) {
9520 Some(entity2) if entity1 == entity2 => continue,
9521 _ => return false,
9522 }
9523 }
9524 true
9525 }
9526
9527 /// Compare rows based on their values (backward compatibility)
9528 fn rows_equal_by_values(&self, row1: &Row, row2: &Row) -> bool {

Callers 4

execute_unionMethod · 0.80
execute_intersectMethod · 0.80
execute_exceptMethod · 0.80
rows_equalMethod · 0.80

Calls 4

rows_equal_by_valuesMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected