Skip to content

Conversation

@SeasonPilot
Copy link
Contributor

What changes were proposed in this pull request?

Implement ISO-GQL PROPERTY_EXISTS predicate function according to Section 19.13 specification.

Core Changes:

  • Add PropertyExists UDF class in org.apache.geaflow.dsl.udf.table.other
  • Register PROPERTY_EXISTS function in BuildInSqlFunctionTable
  • Implement three-valued logic (True/False/NULL) for graph elements
  • Support vertices, edges, and rows with proper NULL handling

Features:

  • ISO-GQL Section 19.13 compliant implementation
  • Three-valued logic: NULL element → NULL, existing property → TRUE
  • Multiple eval() overloads for RowVertex, RowEdge, Row, and Object
  • Complete JavaDoc documentation with standard references

Test Coverage:

  • Unit tests: PropertyExistsTest with 5 test cases
  • SQL integration tests: 3 test cases covering SELECT, WHERE, and edge scenarios
  • All tests passed (5/5), Checkstyle: 0 violations

How was this PR tested?

  • Tests have Added for the changes
    • Unit tests: PropertyExistsTest.java (5 test methods)
    • SQL tests: gql_property_exists_001/002/003.sql
    • Test results: 5/5 passed, 0.729s execution time
  • Production environment verified
    • Build: SUCCESS (geaflow-dsl-plan module)
    • Checkstyle: 0 violations
    • Apache RAT: All files approved (281 licenses)
    • Compilation: No errors or warnings

Closes #359"

Implement PROPERTY_EXISTS function according to ISO-GQL Section 19.13.

Features:
- ISO-GQL compliant PROPERTY_EXISTS predicate
- Three-valued logic support (True/False/NULL)
- Support for vertices, edges, and rows
- Comprehensive unit tests and SQL test cases

Implementation:
- Add PropertyExists UDF class
- Register function in BuildInSqlFunctionTable
- Add PropertyExistsTest with 5 test cases (100% pass)
- Add 3 SQL integration test cases

Testing:
- Unit tests: 5/5 passed
- Checkstyle: 0 violations
- Build: SUCCESS

Closes apache#359
@Manakaa
Copy link

Manakaa commented Dec 7, 2025

Hi @SeasonPilot. About this PR. I saw you just implement the simpify PROPERTY_EXISTS predicate. Will you add more change for this issue?

…pache#359)

Refactor PROPERTY_EXISTS to follow GeaFlow's established ISO-GQL predicate
pattern by introducing PropertyExistsFunctions utility class.

This aligns PropertyExists with IsSourceOf/IsDestinationOf implementation
and addresses technical debt from the initial implementation.

**Architecture Improvements:**
- Add PropertyExistsFunctions utility class (three-layer pattern)
  * UDF → Utility → Business Logic
- Delegate all eval() methods to utility class
- Implement type validation with IllegalArgumentException
- Add property name validation (null/empty checks)
- Maintain ISO-GQL three-valued logic (NULL → null)

**Error Handling:**
- Invalid element type → clear error messages with type info
- NULL/empty property name → descriptive error messages
- Consistent with SourceDestinationFunctions error handling

**Testing:**
- Expand from 4 to 13 tests (+225% coverage)
- Add 9 error handling tests:
  * Invalid element types (String, Integer)
  * NULL/empty/whitespace property names
  * Error message validation
  * Type-specific overload testing
- All 13/13 tests pass

**Code Quality:**
- Checkstyle: 0 violations
- Comprehensive Javadoc with ISO-GQL Section 19.13 reference
- Design decision documentation
- Implementation notes for Row interface limitations

**Implementation Strategy:**
- Runtime validation follows compile-time checking approach
- Row interface indexed access documented
- Future runtime schema validation options identified

**Files:**
- NEW: PropertyExistsFunctions.java (137 lines)
- MOD: PropertyExists.java (refactored to delegation)
- MOD: PropertyExistsTest.java (comprehensive tests)

**Build Status:**
- Tests: 13 run, 0 failures, 0 errors
- Checkstyle: PASS
- Build: SUCCESS
@SeasonPilot
Copy link
Contributor Author

Hi @SeasonPilot. About this PR. I saw you just implement the simpify PROPERTY_EXISTS predicate. Will you add more change for this issue?

Hi @Manakaa ! Thanks for your attention to this PR. I've just pushed the refined/improved code for this issue, which includes the complete implementation of the PROPERTY_EXISTS predicate (beyond the initial simplified version). Feel free to review the latest commits when you have time.

@SeasonPilot
Copy link
Contributor Author

#359

Copy link
Contributor

@Leomrlin Leomrlin left a comment

Choose a reason for hiding this comment

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

LGTM

@yaozhongq yaozhongq self-requested a review January 6, 2026 03:51
yaozhongq

This comment was marked as duplicate.

Copy link
Contributor

@yaozhongq yaozhongq left a comment

Choose a reason for hiding this comment

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

LGTM

@yaozhongq yaozhongq merged commit f891ede into apache:master Jan 6, 2026
2 checks passed
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.

Added implementation of standard ISO-GQL syntax(2):property_exitss predicate

4 participants