Skip to content

Conversation

carminite
Copy link
Contributor

@carminite carminite commented Sep 12, 2025

Description

Implemented PROPERTIES(NODE|REL|STRUCT) for returning the (non-internal) properties of a variable.

Usage:

RETURN PROPERTIES({name: 'alice', age: 9, nullvar: null});
{name: alice, age: 9, nullvar: }

MATCH (p:person) RETURN properties(p);
{ID: 0, fName: Alice, age: 9, ...}

MATCH (p:person)-[e:knows]->(:person) RETURN properties(e);
{date: 2021-06-30, meetTime: 1986-10-21 21:08:31.521, ...}

Contributor agreement

@carminite carminite changed the title wip Implement properties() for NODE, REL, STRUCT Sep 12, 2025
@carminite
Copy link
Contributor Author

carminite commented Sep 12, 2025

Questions for @andyfengHKU:

  • What's the difference between SCALAR_FUNCTION and REWRITE_FUNCTION (as in src/function/function_collection.cpp)? (turned out to be irrelevant)
  • There's already a properties(LIST, STRING) implementation in src/function/path/properties_function.cpp. Can I override it in any way? (implemented as STRUCT_PROPERTIES())
  • What happens to functors (e.g. bindFunc, compileFunc) if they aren't assigned? Is there a default?
  • Favourite cooking oil?

@carminite carminite changed the title Implement properties() for NODE, REL, STRUCT [WIP] Implement properties() for NODE, REL, STRUCT Sep 12, 2025
@carminite carminite changed the title [WIP] Implement properties() for NODE, REL, STRUCT Implement STRUCT_PROPERTIES(NODE|REL|STRUCT) Sep 12, 2025
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 97.53086% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.74%. Comparing base (d33be14) to head (4a10776).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/function/utility/properties.cpp 97.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6009      +/-   ##
==========================================
- Coverage   86.31%   85.74%   -0.57%     
==========================================
  Files        1456     1642     +186     
  Lines       65856    75940   +10084     
  Branches     8037     9037    +1000     
==========================================
+ Hits        56841    65118    +8277     
- Misses       8756    10561    +1805     
- Partials      259      261       +2     
Flag Coverage Δ
extension 63.47% <54.32%> (?)
in-mem 81.03% <97.53%> (+0.01%) ⬆️
on-disk 86.40% <97.53%> (+0.01%) ⬆️
recovery 86.40% <97.53%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

github-actions bot commented Sep 12, 2025

Benchmark Result

Master commit hash: 92f5a9c007ceb54817b03369bbbce237f67a61b5
Branch commit hash: e5c00e8e4c4f985da2025f7fd8951861a59a8fd5

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
join q31 9.20 6.61 2.59 (39.23%)
Other queries
Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 705.86 706.60 -0.74 (-0.10%)
aggregation q28 7747.36 7711.25 36.10 (0.47%)
filter q14 61.08 60.01 1.06 (1.77%)
filter q15 66.15 62.88 3.27 (5.20%)
filter q16 278.21 279.55 -1.34 (-0.48%)
filter q17 382.66 383.25 -0.59 (-0.15%)
filter q18 1876.39 1876.03 0.36 (0.02%)
filter zonemap-node 23.32 23.94 -0.63 (-2.61%)
filter zonemap-node-lhs-cast 23.81 24.22 -0.40 (-1.67%)
filter zonemap-node-null 24.10 24.15 -0.05 (-0.20%)
filter zonemap-rel 5448.29 5468.70 -20.41 (-0.37%)
fixed_size_expr_evaluator q07 626.05 626.66 -0.61 (-0.10%)
fixed_size_expr_evaluator q08 908.55 910.69 -2.14 (-0.24%)
fixed_size_expr_evaluator q09 911.44 911.16 0.28 (0.03%)
fixed_size_expr_evaluator q10 197.83 198.88 -1.06 (-0.53%)
fixed_size_expr_evaluator q11 197.93 198.44 -0.51 (-0.26%)
fixed_size_expr_evaluator q12 175.98 176.34 -0.36 (-0.21%)
fixed_size_expr_evaluator q13 1493.42 1495.14 -1.71 (-0.11%)
fixed_size_seq_scan q23 56.29 53.50 2.79 (5.22%)
join q29 772.93 810.88 -37.95 (-4.68%)
join q30 1831.22 1706.88 124.34 (7.28%)
join SelectiveTwoHopJoin 53.26 54.99 -1.73 (-3.14%)
ldbc_snb_ic q35 10.19 9.13 1.06 (11.60%)
ldbc_snb_ic q36 97.96 98.07 -0.10 (-0.11%)
ldbc_snb_is q32 4.39 4.11 0.29 (6.96%)
ldbc_snb_is q33 16.99 17.79 -0.80 (-4.49%)
ldbc_snb_is q34 1.22 1.23 -0.01 (-0.57%)
limit push-down-limit-into-distinct 1952.22 1966.62 -14.40 (-0.73%)
multi-rel multi-rel-large-scan 1498.52 1429.35 69.17 (4.84%)
multi-rel multi-rel-lookup 8.49 8.85 -0.37 (-4.14%)
multi-rel multi-rel-small-scan 206.18 197.69 8.49 (4.29%)
order_by q25 69.37 64.67 4.71 (7.28%)
order_by q26 382.04 378.12 3.92 (1.04%)
order_by q27 1306.60 1309.16 -2.56 (-0.20%)
recursive_join recursive-join-bidirection 328.21 319.97 8.24 (2.57%)
recursive_join recursive-join-dense 7115.45 7132.87 -17.42 (-0.24%)
recursive_join recursive-join-path 23852.25 23860.91 -8.66 (-0.04%)
recursive_join recursive-join-sparse 9.28 9.11 0.16 (1.78%)
recursive_join recursive-join-trail 7079.60 7086.60 -7.01 (-0.10%)
scan_after_filter q01 113.82 108.66 5.17 (4.75%)
scan_after_filter q02 93.78 94.40 -0.62 (-0.66%)
shortest_path_ldbc100 q37 152.82 146.59 6.23 (4.25%)
shortest_path_ldbc100 q38 308.55 314.02 -5.47 (-1.74%)
shortest_path_ldbc100 q39 102.64 106.00 -3.36 (-3.17%)
shortest_path_ldbc100 q40 499.37 517.49 -18.12 (-3.50%)
var_size_expr_evaluator q03 2120.39 2111.28 9.11 (0.43%)
var_size_expr_evaluator q04 2145.79 2139.21 6.58 (0.31%)
var_size_expr_evaluator q05 2588.46 2575.02 13.44 (0.52%)
var_size_expr_evaluator q06 1258.08 1260.77 -2.69 (-0.21%)
var_size_seq_scan q19 1358.79 1346.50 12.30 (0.91%)
var_size_seq_scan q20 2535.49 2552.76 -17.27 (-0.68%)
var_size_seq_scan q21 2157.55 2151.57 5.98 (0.28%)
var_size_seq_scan q22 109.19 109.35 -0.16 (-0.15%)

@sdht0
Copy link
Contributor

sdht0 commented Sep 13, 2025

Is having a special STRUCT_PROPERTIES(x) helpful when returning x has (almost) same outcome (with internal keys present)? properties() was in listed in #5841 for openCypher conformance. If we're changing the name of the function, then I'm not sure in which scenario we expect to use it as compared to simply returning the argument of the function itself.

@carminite
Copy link
Contributor Author

@sdht0 you're definitely right, i'll probably find a way to alias/group both properties() functions together. i just wanted this pr open right now for code reviews because raii is hard ;-;

@carminite carminite changed the title Implement STRUCT_PROPERTIES(NODE|REL|STRUCT) Implement PROPERTIES(NODE|REL|STRUCT) Sep 15, 2025
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.

2 participants