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

[BUG]] [GPU Error Bug] "SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('<string>'), false FROM <table>" brings Error #1232

Open
qwebug opened this issue Sep 20, 2023 · 0 comments
Labels
bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer

Comments

@qwebug
Copy link

qwebug commented Sep 20, 2023

What happened:

"SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('<string>'), false FROM <table>" brings error, when using GPU.

However it is able to output result, when using CPU.

What you expected to happen:

It will not bring error, when using GPU.

Minimal Complete Verifiable Example:

import pandas as pd
import dask.dataframe as dd
from dask_sql import Context

c = Context()

df0 = pd.DataFrame({
    'c0': [835.0000],
})
t0 = dd.from_pandas(df0, npartitions=1)

c.create_table('t0', t0, gpu=False)
c.create_table('t0_gpu', t0, gpu=True)

print('CPU Result:')
result1= c.sql("SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('A'), false FROM t0").compute()
print(result1)

print('GPU Result:')
result2= c.sql("SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('A'), false FROM t0_gpu").compute()
print(result2)

Result:

INFO:numba.cuda.cudadrv.driver:init
CPU Result:
   CASE Boolean(false) WHEN Boolean(true) THEN Boolean(true) WHEN Boolean(false) THEN Boolean(false) END Utf8("A")  Boolean(false)
0                                              False                                                             A           False
GPU Result:
Traceback (most recent call last):
  File "/tmp/bug.py", line 20, in <module>
    result2= c.sql("SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('A'), false FROM t0_gpu").compute()
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask_sql/context.py", line 513, in sql
    return self._compute_table_from_rel(rel, return_futures)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask_sql/context.py", line 869, in _compute_table_from_rel
    df = dc.assign()
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask_sql/datacontainer.py", line 229, in assign
    df.columns = self.column_container.columns
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask/dataframe/core.py", line 4887, in __setattr__
    object.__setattr__(self, key, value)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask/dataframe/core.py", line 4746, in columns
    renamed = _rename_dask(self, columns)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask/dataframe/core.py", line 7084, in _rename_dask
    metadata = _rename(names, df._meta)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/dask/dataframe/core.py", line 7055, in _rename
    df.columns = columns
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/cudf/core/dataframe.py", line 1094, in __setattr__
    super().__setattr__(key, col)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/nvtx/nvtx.py", line 101, in inner
    result = func(*args, **kwargs)
  File "/opt/conda/envs/rapids/lib/python3.10/site-packages/cudf/core/dataframe.py", line 2473, in columns
    raise ValueError(
ValueError: Length mismatch: expected 2 elements, got 3 elements

Anything else we need to know?:

Environment:

@qwebug qwebug added bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer labels Sep 20, 2023
@qwebug qwebug changed the title [BUG]] [Error Bug] "SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('<string>'), false FROM <table>" brings Error [BUG]] [GPU Error Bug] "SELECT (CASE false WHEN (true) THEN (true) WHEN false THEN false END ), ('<string>'), false FROM <table>" brings Error Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer
Projects
None yet
Development

No branches or pull requests

1 participant