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

sql: add absolute value unary operator (@) #47543

Open
jordanlewis opened this issue Apr 15, 2020 · 2 comments
Open

sql: add absolute value unary operator (@) #47543

jordanlewis opened this issue Apr 15, 2020 · 2 comments

Comments

@jordanlewis
Copy link
Member

@jordanlewis jordanlewis commented Apr 15, 2020

In PostgreSQL, @ is a unary operator that returns the absolute value of a number. For example:

jordan=# select @ -5.0;
 ?column?
----------
      5.0
(1 row)

CockroachDB is missing such a unary operator.

@naivcit
Copy link

@naivcit naivcit commented Apr 17, 2020

Can I take this up too ?

@rohany
Copy link
Contributor

@rohany rohany commented Apr 21, 2020

@abhishek20123g was looking into this, and I think that it is going to be difficult to implement this. Because we support column references in expressions (e.g. @1::INT), this is going to be ambiguous with trying to parse '@' expr as a function call.

@rohany rohany moved this from Backlog to Long Term / Blocked in SQL Features Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
SQL Features
  
Long Term / Blocked
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.