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

feat(duckdb): Parse ** and ^ operators as POW #4193

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Conversation

VaggelisD
Copy link
Collaborator

Fixes #4186

These are all aliases:

D SELECT * FROM duckdb_functions() WHERE function_name IN ('**', '^', 'pow', 'power');
┌───────────────┬──────────────┬─────────────┬───────────────┬───────────────┬──────────────────────────────┬─────────┬──────┬─────────────┬────────────┬──────────────────┬─────────┬──────────────────┬──────────────────┬──────────┬──────────────┬───────────┬────────────┐
│ database_name │ database_oid │ schema_name │ function_name │ function_type │         description          │ comment │ tags │ return_type │ parameters │ parameter_types  │ varargs │ macro_definition │ has_side_effects │ internal │ function_oid │  example  │ stability  │
├───────────────┼──────────────┼─────────────┼───────────────┼───────────────┼──────────────────────────────┼─────────┼──────┼─────────────┼────────────┼──────────────────┼─────────┼──────────────────┼──────────────────┼──────────┼──────────────┼───────────┼────────────┤
│ system        │ 0            │ main        │ **            │ scalar        │ Computes x to the power of y │         │ {}   │ DOUBLE      │ [x, y]     │ [DOUBLE, DOUBLE] │         │                  │ false            │ true     │ 408          │ pow(2, 3) │ CONSISTENT │
│ system        │ 0            │ main        │ ^             │ scalar        │ Computes x to the power of y │         │ {}   │ DOUBLE      │ [x, y]     │ [DOUBLE, DOUBLE] │         │                  │ false            │ true     │ 426          │ pow(2, 3) │ CONSISTENT │
│ system        │ 0            │ main        │ pow           │ scalar        │ Computes x to the power of y │         │ {}   │ DOUBLE      │ [x, y]     │ [DOUBLE, DOUBLE] │         │                  │ false            │ true     │ 902          │ pow(2, 3) │ CONSISTENT │
│ system        │ 0            │ main        │ power         │ scalar        │ Computes x to the power of y │         │ {}   │ DOUBLE      │ [x, y]     │ [DOUBLE, DOUBLE] │         │                  │ false            │ true     │ 904          │ pow(2, 3) │ CONSISTENT │
└───────────────┴──────────────┴─────────────┴───────────────┴───────────────┴──────────────────────────────┴─────────┴──────┴─────────────┴────────────┴──────────────────┴─────────┴──────────────────┴──────────────────┴──────────┴──────────────┴───────────┴────────────┘

@VaggelisD VaggelisD merged commit 0adbbf7 into main Oct 1, 2024
6 checks passed
@VaggelisD VaggelisD deleted the vaggelisd/duckdb_pow branch October 1, 2024 15:41
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.

DuckDB ^ operator is parsed incorrectly as XOR when it should be POW
3 participants