5 kyu
Vector addition
169FArekkusu
Loading description...
Databases
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I think it would be much better if instead of writing about SQL magic, it would simply inform users about the creation of the operator.
I have a solutions that works using 'create function - unnest - ordinality - cardinality', but still I hece the same error: I do not what is happening....any suggestion? Thks
--- Caused by: ---
PG::UndefinedFunction:
ERROR: operator does not exist: integer[] + integer[]
LINE 1: SELECT id, a, b, c, a + b AS "a + b", (a + b) + c AS "(a + b...
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
/usr/local/bundle/gems/sequel-5.47.0/lib/sequel/adapters/postgres.rb:156:in `exec'
No examples found.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I'm rather new to this and I never have made a function let alone try to alter a binary operator. This is using the CREATE FUNCTION ultility within the language, yes? https://www.postgresql.org/docs/current/sql-createfunction.html
I believe my solution is working correctly but I'm getting this kind of error (which actualy is not from my code):
PG::UndefinedFunction:
ERROR: operator does not exist: integer[] + integer[]
LINE 1: SELECT id, a, b, c, a + b AS "a + b", (a + b) + c AS "(a + b...
Could someone explain this to me, please?
Your solution is incomplete (and the error message comes from it not fulfilling the requirements).
This comment has been hidden.
Are you sure that checking works in an appropriate way? An error appears every time during the checking, even we have only 'SELECT * FROM arrays' statement.
An error occurred while loading ./main.rb. Failure/Error: @db.log_connection_yield(sql, self, args){args ? async_exec(sql, args) : async_exec(sql)}
You're not supposed to
SELECT
anything from anywhere yourself, not an issue.it's approvable now, anyone feeling brave enough can do it
after last time's debacle, I'd say a mod should do it
approved by someone
I'm a bit confused about the structure. Your example show arrays "a" and "b", but the sample tests show 3 arrays. Should we add 2, 3 or a dynamic number of arrays together?
+
is a binary operator, how are you going to add more than 2 arrays at once?with some kind of "fold" (+)
The tests simply try to evaluate a
(a + b) + c
expression, what "dynamic number of arrays" and "fold (+)
" are you talking about? Are you asking for an explanation of how addition works, or something?I'm resolving this question because it makes zero sense whatsover.
I read over the fact we are required to create an operator and thought we needed to make a query instead.