-
Notifications
You must be signed in to change notification settings - Fork 390
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
Properly cast reductions when necessary #1130
Conversation
cc @llllllllll can you try this out on a few things on your side? this touches some often hit code paths, i want to make sure nothing major is borked. |
ugh it looks like spark 1.2 doesn't allow casting to anything but |
@llllllllll i'd like to get this in, any chance you could review this tomorrow and/or try it out to make sure there are no major breakages? i've run it on some simple redshift queries (this was partly the impetus for this change) and things are working |
Sure thing, I will test this tomorrow morning at work |
awesome thx! Best, On Sun, Jun 14, 2015 at 11:04 PM, Joe Jevnik notifications@github.com
|
To test, I created a table with a single bool column in postgres; however, I could not cast bools to floats
|
bz=# select cast(False as int);
int4
------
0
(1 row)
bz=# select cast(False as float);
ERROR: cannot cast type boolean to double precision
LINE 1: select cast(False as float);
^
bz=# select cast(False as int);
int4
------
0
(1 row)
bz=# select cast(cast(False as int) as decimal);
numeric
---------
0
(1 row)
It looks like we can actually cast to int an then to numeric though |
i think casting to |
closing in favor of #1137 |
closes #1050
also restricts the scope of most reductions (notable exceptions are count and nelements)
to only work on sqlalchemy.elements.ColumnElements, rather than the generic ClauseElement.