DeepDiff library to compare query output metrics
such as row counts and data samples, with tolerance for sorting differences and precision variances.
react_agent.custom_tools.query_validator.SourceQueryInput Objects
validation_schema_code- Source schema validation code containing imports, initialization, context setup, and minor fetch validation logic.validation_harness_code- Runnable execution harness code that runs the C# LINQ queries, captures count/samples, and writes the structured output JSON.source_framework- The relational source framework target (e.g. EF Core, Dapper).entry_type_name- Declared main class/type name containing the entry point.entry_method_name- Declared main static method name serving as execution entry.
react_agent.custom_tools.query_validator.TargetQueryInput Objects
validation_schema_code- Target schema validation code containing imports, bootstrapping, entity annotations, and driver configuration.validation_harness_code- Runnable execution harness code that runs the Java MongoDB/Neo4j queries, captures count/samples, and writes the structured output JSON.target_framework- The target framework target (e.g. Spring Data MongoDB, Spring Data Neo4j).entry_type_name- Declared main public class name containing the entry point.entry_method_name- Declared main static method name serving as execution entry.
react_agent.custom_tools.query_validator.QueryEquivalenceInput Objects
source_validation_output- Text/log output produced by executing source validation.target_validation_output- Text/log output produced by executing target validation.
react_agent.custom_tools.query_validator.check_query_equivalence
DeepDiff to evaluate whether they returned identical counts
and matching records.
It implements a robust sorting-tolerant comparison logic (swapped orders) to prevent false-positives
when database drivers iterate or sort query datasets differently under relational vs NoSQL engines.
Arguments:
source_validation_output- String output logging from source validation tool.target_validation_output- String output logging from target validation tool.runtime- Injected LangChain ToolRuntime context to access state and configuration.