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

Revisit Impala's CASE expression type precedence rules #93

Closed
wesm opened this issue Apr 21, 2015 · 7 comments
Closed

Revisit Impala's CASE expression type precedence rules #93

wesm opened this issue Apr 21, 2015 · 7 comments
Assignees
Labels
bug Incorrect behavior inside of ibis impala The Apache Impala backend

Comments

@wesm
Copy link
Member

wesm commented Apr 21, 2015

Issue by wesm
Friday Jan 30, 2015 at 22:37 GMT
Originally opened as http://github.mtv.cloudera.com/wesm/ibis/issues/93


see #31

@wesm wesm added this to the 0.3 - First Beta milestone Apr 21, 2015
@wesm wesm added the bug Incorrect behavior inside of ibis label Apr 21, 2015
@wesm wesm modified the milestones: 0.3, 0.4 Jun 30, 2015
@wesm wesm modified the milestones: 0.5, 0.4 Jul 28, 2015
@wesm wesm modified the milestones: 0.6, 0.5 Aug 19, 2015
@wesm wesm modified the milestones: 0.6, Future Sep 14, 2015
@cpcloud cpcloud modified the milestones: Future, 0.14 Nov 24, 2017
@cpcloud
Copy link
Member

cpcloud commented Nov 24, 2017

The postgres algorithm for deciding the output type looks reasonable here: https://www.postgresql.org/docs/current/static/typeconv-union-case.html

@cpcloud cpcloud self-assigned this Nov 24, 2017
@kszucs
Copy link
Member

kszucs commented Mar 25, 2018

@cpcloud This issue seems a bit outdated, should we still revisit?

@cpcloud
Copy link
Member

cpcloud commented Apr 2, 2018

This is really a backlog issue, that we may or may not get to after other higher priority issues are done. We can still leave it open though.

@xmnlab
Copy link
Contributor

xmnlab commented Apr 11, 2018

Hi all,

I am trying the follow code but it raises an error: IbisTypeError: Cannot compute precedence for int32 and string types

t0 = ibis.table(
    [('one', 'string'),
     ('two', 'double'),
     ('three', 'int32')], 'my_data')

expr = (
    t0.three
        .case()
        .when(0, 'low')
        .when(1, 'high')
        .else_('null')
        .end()
        .name('label')
)

print(t0[expr].limit(10).compile())

How can I allow this? I need it because I am creating a backend and it allow this kind of operation.

@cpcloud
Copy link
Member

cpcloud commented Apr 11, 2018

@xmnlab This looks like a bug since the types you've written in your example are perfectly valid.

@cpcloud
Copy link
Member

cpcloud commented Apr 11, 2018

I'm going to move your example to a separate issue.

@cpcloud cpcloud modified the milestones: 0.14, Future Jul 30, 2018
@datapythonista datapythonista removed this from the Future milestone Nov 13, 2020
@cpcloud cpcloud changed the title Revisit Impala's CASE expression type precendence rules Revisit Impala's CASE expression type precedence rules Nov 22, 2021
@cpcloud
Copy link
Member

cpcloud commented Nov 22, 2021

Closing as stale.

@cpcloud cpcloud closed this as completed Nov 22, 2021
@saulpw saulpw added the impala The Apache Impala backend label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis impala The Apache Impala backend
Projects
None yet
Development

No branches or pull requests

6 participants