-
Notifications
You must be signed in to change notification settings - Fork 110
Conversation
[]sql.Row{{int64(4)}}, | ||
}, | ||
{ | ||
`SELECT LEAST(1, 2, 3, 4)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add some tests using strings too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And some tests using table columns too, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajnavarro there are already tests with strings on greatest_latest_test.go
(the ones called "all strings", "all strings and empty", and a couple mixing strings with other types).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajnavarro , @erizocosmico added tests with strings and tables to this file, PTAL.
6de29fc
to
c20ec39
Compare
b8660ef
to
df87b11
Compare
Return type deduction implemented as suggested plus some factorizing for |
} | ||
|
||
switch t := val.(type) { | ||
case int, int32, int64: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about unsigned
variants?
I don't want to be too much tiquismiquis
, but maybe we should stick just to 2 options - string
or float64
.
I remember we had the same pleasure fighting with different types for arithmetic functions (max, min, avg, ...) and ultimately we decided to stick to float64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there is not much difference between supporting only string
and float64
and also supporting int/32/64
but not unsigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just meant:
if string {
// convert to string
} else {
// convert to float64
}
if we wanna keep the current implementation it's fine, if we add int8, int16 and unsigned variants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanjux LGTM after resolving conflicts! |
typo fix Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
@ajnavarro done! |
GREATEST
andLEAST
functions.SUPPORTED.md
.Signed-off-by: Juanjo Alvarez juanjo@sourced.tech