Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error messages when forgetting to load extension #4771

Merged
merged 11 commits into from
Jan 23, 2025

Conversation

royi-luo
Copy link
Collaborator

@royi-luo royi-luo commented Jan 22, 2025

Description

If a function cannot be found in the catalog performs a lookup in a hard-coded map and if the function name matches reports the extension the function is from. Messages are now something like:
Catalog exception: function QUERY_FTS_INDEX does not exist. This function exists in the FTS extension. You can load the extension by running the command 'LOAD EXTENSION FTS'.

Also added similar improvements to types:
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
and file formats:
Binder exception: Cannot load from file type delta. Reason: Catalog exception: function delta_SCAN does not exist. This function exists in the DELTA extension. You can load the extension by running the command 'LOAD EXTENSION DELTA'.

Fixes #4760

Contributor agreement

@royi-luo royi-luo self-assigned this Jan 22, 2025
@royi-luo royi-luo requested a review from acquamarin January 22, 2025 23:03
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.32%. Comparing base (99dd5dc) to head (234d807).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/catalog/catalog.cpp 95.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #4771    +/-   ##
========================================
  Coverage   86.31%   86.32%            
========================================
  Files        1397     1398     +1     
  Lines       59935    60213   +278     
  Branches     7384     7402    +18     
========================================
+ Hits        51734    51977   +243     
- Misses       8034     8070    +36     
+ Partials      167      166     -1     

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

Copy link

Benchmark Result

Master commit hash: f33c700493fb063a15e2346839adf5bca918324d
Branch commit hash: 1b9278dddc888f0dc5d0d12886892f15e73611b9

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 639.01 657.28 -18.27 (-2.78%)
aggregation q28 11398.47 11216.95 181.51 (1.62%)
filter q14 129.30 144.53 -15.22 (-10.53%)
filter q15 129.04 148.36 -19.32 (-13.02%)
filter q16 308.18 320.43 -12.25 (-3.82%)
filter q17 448.25 469.32 -21.07 (-4.49%)
filter q18 1937.62 1947.25 -9.63 (-0.49%)
filter zonemap-node 90.24 105.04 -14.81 (-14.09%)
filter zonemap-node-lhs-cast 88.83 107.68 -18.85 (-17.51%)
filter zonemap-node-null 85.39 101.23 -15.85 (-15.65%)
filter zonemap-rel 5868.09 5908.43 -40.34 (-0.68%)
fixed_size_expr_evaluator q07 579.76 587.58 -7.81 (-1.33%)
fixed_size_expr_evaluator q08 824.58 817.30 7.28 (0.89%)
fixed_size_expr_evaluator q09 825.85 818.55 7.30 (0.89%)
fixed_size_expr_evaluator q10 244.98 253.37 -8.39 (-3.31%)
fixed_size_expr_evaluator q11 239.19 244.93 -5.74 (-2.34%)
fixed_size_expr_evaluator q12 240.88 242.01 -1.13 (-0.47%)
fixed_size_expr_evaluator q13 1476.77 1469.38 7.39 (0.50%)
fixed_size_seq_scan q23 123.30 128.71 -5.41 (-4.20%)
join q29 590.05 593.41 -3.35 (-0.56%)
join q30 9755.16 10138.13 -382.97 (-3.78%)
join q31 5.44 8.44 -3.01 (-35.62%)
join SelectiveTwoHopJoin 55.41 57.11 -1.70 (-2.98%)
ldbc_snb_ic q35 2619.44 2704.02 -84.59 (-3.13%)
ldbc_snb_ic q36 488.85 454.99 33.87 (7.44%)
ldbc_snb_is q32 5.29 6.29 -1.01 (-15.98%)
ldbc_snb_is q33 14.89 15.35 -0.46 (-2.96%)
ldbc_snb_is q34 1.32 1.31 0.01 (0.43%)
multi-rel multi-rel-large-scan 1398.65 1427.65 -29.00 (-2.03%)
multi-rel multi-rel-lookup 10.35 8.94 1.41 (15.83%)
multi-rel multi-rel-small-scan 81.84 92.32 -10.48 (-11.35%)
order_by q25 131.34 144.36 -13.02 (-9.02%)
order_by q26 473.04 477.17 -4.13 (-0.87%)
order_by q27 1467.29 1482.99 -15.70 (-1.06%)
recursive_join recursive-join-bidirection 281.43 300.64 -19.20 (-6.39%)
recursive_join recursive-join-dense 7482.79 7402.46 80.34 (1.09%)
recursive_join recursive-join-path 23842.22 23583.05 259.18 (1.10%)
recursive_join recursive-join-sparse 1059.82 1059.89 -0.06 (-0.01%)
recursive_join recursive-join-trail 7422.83 7361.63 61.19 (0.83%)
scan_after_filter q01 173.03 186.89 -13.86 (-7.41%)
scan_after_filter q02 158.76 175.50 -16.74 (-9.54%)
shortest_path_ldbc100 q37 93.91 89.07 4.84 (5.44%)
shortest_path_ldbc100 q38 379.87 387.00 -7.13 (-1.84%)
shortest_path_ldbc100 q39 62.69 69.29 -6.60 (-9.53%)
shortest_path_ldbc100 q40 442.45 433.42 9.03 (2.08%)
var_size_expr_evaluator q03 2079.33 2081.77 -2.44 (-0.12%)
var_size_expr_evaluator q04 2245.78 2204.12 41.66 (1.89%)
var_size_expr_evaluator q05 2685.59 2633.92 51.67 (1.96%)
var_size_expr_evaluator q06 1324.68 1346.18 -21.50 (-1.60%)
var_size_seq_scan q19 1450.85 1468.66 -17.82 (-1.21%)
var_size_seq_scan q20 2777.68 2823.73 -46.06 (-1.63%)
var_size_seq_scan q21 2313.68 2394.63 -80.96 (-3.38%)
var_size_seq_scan q22 127.37 129.54 -2.17 (-1.67%)

Copy link

Benchmark Result

Master commit hash: f33c700493fb063a15e2346839adf5bca918324d
Branch commit hash: 7472af58ef12a5ec640df6b8b5dbcace4b9a4e3a

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 696.89 657.28 39.62 (6.03%)
aggregation q28 6073.16 11216.95 -5143.80 (-45.86%)
filter q14 137.90 144.53 -6.63 (-4.59%)
filter q15 135.00 148.36 -13.36 (-9.01%)
filter q16 312.31 320.43 -8.12 (-2.53%)
filter q17 455.15 469.32 -14.16 (-3.02%)
filter q18 1926.13 1947.25 -21.13 (-1.08%)
filter zonemap-node 98.21 105.04 -6.83 (-6.50%)
filter zonemap-node-lhs-cast 96.84 107.68 -10.84 (-10.07%)
filter zonemap-node-null 92.78 101.23 -8.46 (-8.35%)
filter zonemap-rel 5758.20 5908.43 -150.23 (-2.54%)
fixed_size_expr_evaluator q07 588.77 587.58 1.19 (0.20%)
fixed_size_expr_evaluator q08 817.89 817.30 0.58 (0.07%)
fixed_size_expr_evaluator q09 819.52 818.55 0.97 (0.12%)
fixed_size_expr_evaluator q10 253.82 253.37 0.45 (0.18%)
fixed_size_expr_evaluator q11 246.42 244.93 1.49 (0.61%)
fixed_size_expr_evaluator q12 243.37 242.01 1.36 (0.56%)
fixed_size_expr_evaluator q13 1464.75 1469.38 -4.63 (-0.31%)
fixed_size_seq_scan q23 126.91 128.71 -1.80 (-1.40%)
join q29 597.12 593.41 3.71 (0.63%)
join q30 10670.08 10138.13 531.95 (5.25%)
join q31 5.45 8.44 -3.00 (-35.49%)
join SelectiveTwoHopJoin 50.02 57.11 -7.09 (-12.42%)
ldbc_snb_ic q35 2587.24 2704.02 -116.79 (-4.32%)
ldbc_snb_ic q36 477.05 454.99 22.06 (4.85%)
ldbc_snb_is q32 5.77 6.29 -0.52 (-8.27%)
ldbc_snb_is q33 12.67 15.35 -2.67 (-17.42%)
ldbc_snb_is q34 1.41 1.31 0.10 (7.38%)
multi-rel multi-rel-large-scan 1397.61 1427.65 -30.04 (-2.10%)
multi-rel multi-rel-lookup 20.05 8.94 11.12 (124.44%)
multi-rel multi-rel-small-scan 93.23 92.32 0.90 (0.98%)
order_by q25 146.05 144.36 1.69 (1.17%)
order_by q26 457.93 477.17 -19.24 (-4.03%)
order_by q27 1497.16 1482.99 14.17 (0.96%)
recursive_join recursive-join-bidirection 317.59 300.64 16.96 (5.64%)
recursive_join recursive-join-dense 7435.48 7402.46 33.02 (0.45%)
recursive_join recursive-join-path 23804.33 23583.05 221.28 (0.94%)
recursive_join recursive-join-sparse 1055.85 1059.89 -4.04 (-0.38%)
recursive_join recursive-join-trail 7398.63 7361.63 36.99 (0.50%)
scan_after_filter q01 178.55 186.89 -8.34 (-4.46%)
scan_after_filter q02 165.56 175.50 -9.94 (-5.66%)
shortest_path_ldbc100 q37 89.82 89.07 0.75 (0.84%)
shortest_path_ldbc100 q38 372.14 387.00 -14.86 (-3.84%)
shortest_path_ldbc100 q39 61.66 69.29 -7.63 (-11.01%)
shortest_path_ldbc100 q40 390.96 433.42 -42.46 (-9.80%)
var_size_expr_evaluator q03 2100.81 2081.77 19.03 (0.91%)
var_size_expr_evaluator q04 2238.44 2204.12 34.32 (1.56%)
var_size_expr_evaluator q05 2670.98 2633.92 37.05 (1.41%)
var_size_expr_evaluator q06 1353.53 1346.18 7.35 (0.55%)
var_size_seq_scan q19 1478.46 1468.66 9.80 (0.67%)
var_size_seq_scan q20 2694.87 2823.73 -128.86 (-4.56%)
var_size_seq_scan q21 2310.96 2394.63 -83.68 (-3.49%)
var_size_seq_scan q22 130.79 129.54 1.25 (0.97%)

Copy link
Member

@prrao87 prrao87 left a comment

Choose a reason for hiding this comment

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

@royi-luo I had a couple of comments/suggestions.

---- ok
-STATEMENT CREATE (p:person {id: 8, description: to_json({"family": "anatidae", "species": [ "duck", "goose", "swan", null]})})
---- error
Catalog exception: function TO_JSON does not exist. This function exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
Copy link
Member

Choose a reason for hiding this comment

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

Can we not use the words "does not exist" and "exists" in two consecutive sentences? Something like what I suggested.

Suggested change
Catalog exception: function TO_JSON does not exist. This function exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
Catalog exception: function TO_JSON is not defined. This function exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

-CASE DidNotLoadExtension
-STATEMENT create node table person (id INT64, description json, primary key(id));
---- error
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also mention that the user should install the extension before loading it?

Suggested change
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can install and load this extension by running 'INSTALL JSON; LOAD EXTENSION JSON;'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@@ -180,4 +180,4 @@ abc|{l: 5, h: 32}
-CASE UDTInvalidCast
-STATEMENT RETURN CAST(['abc', 'def', 'ghi'] AS JSON[])
---- error
Catalog exception: JSON is neither an internal type nor a user defined type.
Catalog exception: JSON is neither an internal type nor a user defined type. This type exists in the JSON extension. You can load the extension by running the command 'LOAD EXTENSION JSON'.
Copy link
Member

@prrao87 prrao87 Jan 23, 2025

Choose a reason for hiding this comment

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

Same as my above comment (what if the user didn't install the extension itself?). It makes sense to tell them about the installation step too, I think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Copy link

Benchmark Result

Master commit hash: 2a26123055ca9f5be23526618c491b2b929311f0
Branch commit hash: 0f5ca7bf452d0e72ff9503891e3292cfc40baefc

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 692.36 700.80 -8.44 (-1.20%)
aggregation q28 6079.28 6078.74 0.54 (0.01%)
filter q14 126.43 134.36 -7.93 (-5.90%)
filter q15 128.01 133.52 -5.51 (-4.13%)
filter q16 304.09 312.25 -8.16 (-2.61%)
filter q17 448.67 453.29 -4.62 (-1.02%)
filter q18 1895.80 1916.95 -21.15 (-1.10%)
filter zonemap-node 89.24 98.97 -9.73 (-9.83%)
filter zonemap-node-lhs-cast 90.36 97.29 -6.93 (-7.12%)
filter zonemap-node-null 86.33 93.19 -6.86 (-7.36%)
filter zonemap-rel 5891.90 5926.41 -34.51 (-0.58%)
fixed_size_expr_evaluator q07 578.51 590.06 -11.55 (-1.96%)
fixed_size_expr_evaluator q08 809.05 821.41 -12.36 (-1.50%)
fixed_size_expr_evaluator q09 808.73 822.40 -13.67 (-1.66%)
fixed_size_expr_evaluator q10 244.73 253.75 -9.02 (-3.55%)
fixed_size_expr_evaluator q11 235.52 247.61 -12.10 (-4.88%)
fixed_size_expr_evaluator q12 233.47 243.83 -10.36 (-4.25%)
fixed_size_expr_evaluator q13 1451.08 1464.57 -13.49 (-0.92%)
fixed_size_seq_scan q23 116.66 123.07 -6.41 (-5.21%)
join q29 593.77 630.09 -36.32 (-5.76%)
join q30 10022.13 10726.23 -704.10 (-6.56%)
join q31 6.56 5.70 0.85 (14.97%)
join SelectiveTwoHopJoin 52.40 54.14 -1.73 (-3.20%)
ldbc_snb_ic q35 2589.52 2657.64 -68.12 (-2.56%)
ldbc_snb_ic q36 474.21 464.48 9.73 (2.09%)
ldbc_snb_is q32 5.17 6.54 -1.37 (-20.96%)
ldbc_snb_is q33 14.13 13.32 0.80 (6.01%)
ldbc_snb_is q34 1.25 1.24 0.00 (0.27%)
multi-rel multi-rel-large-scan 1321.52 1833.64 -512.13 (-27.93%)
multi-rel multi-rel-lookup 22.86 11.67 11.18 (95.81%)
multi-rel multi-rel-small-scan 108.29 97.31 10.97 (11.28%)
order_by q25 134.09 138.03 -3.94 (-2.85%)
order_by q26 450.05 459.54 -9.49 (-2.07%)
order_by q27 1499.40 1468.69 30.71 (2.09%)
recursive_join recursive-join-bidirection 288.58 292.25 -3.67 (-1.25%)
recursive_join recursive-join-dense 7478.12 7442.50 35.62 (0.48%)
recursive_join recursive-join-path 23526.65 23714.95 -188.30 (-0.79%)
recursive_join recursive-join-sparse 1063.80 1062.12 1.69 (0.16%)
recursive_join recursive-join-trail 7412.70 7408.00 4.70 (0.06%)
scan_after_filter q01 173.61 179.45 -5.84 (-3.26%)
scan_after_filter q02 157.53 165.30 -7.78 (-4.70%)
shortest_path_ldbc100 q37 90.29 92.39 -2.10 (-2.28%)
shortest_path_ldbc100 q38 378.78 388.54 -9.76 (-2.51%)
shortest_path_ldbc100 q39 67.20 65.29 1.92 (2.94%)
shortest_path_ldbc100 q40 469.40 432.08 37.32 (8.64%)
var_size_expr_evaluator q03 2148.18 2099.67 48.51 (2.31%)
var_size_expr_evaluator q04 2215.72 2257.34 -41.61 (-1.84%)
var_size_expr_evaluator q05 2672.26 2648.58 23.68 (0.89%)
var_size_expr_evaluator q06 1355.41 1338.93 16.48 (1.23%)
var_size_seq_scan q19 1495.26 1464.40 30.86 (2.11%)
var_size_seq_scan q20 2673.42 2827.90 -154.48 (-5.46%)
var_size_seq_scan q21 2293.23 2328.22 -34.99 (-1.50%)
var_size_seq_scan q22 130.28 130.13 0.15 (0.12%)

@royi-luo royi-luo marked this pull request as ready for review January 23, 2025 16:11
@royi-luo royi-luo merged commit 7c117eb into master Jan 23, 2025
23 of 25 checks passed
@royi-luo royi-luo deleted the royi/better-extension-function-error-messages branch January 23, 2025 16:11
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.

Feature: Better error messages when forgetting to load extension
3 participants