[BUG] [GPU Logic Bug] SELECT (CASE <column> WHEN (CASE <column> WHEN <column> THEN <column> END) THEN <string> ELSE <column> END) FROM <table> brings Error #1340
SELECT (CASE \ WHEN (CASE \ WHEN \ THEN \ END) THEN \ ELSE \ END) FROM \
brings different results, when using CPU and GPU execution.
What you expected to happen:
It is the same result, when using CPU and GPU execution.
Minimal Complete Verifiable Example:
import pandas as pd
import dask.dataframe as dd
from dask_sql import Context
c = Context()
t0 = dd.read_csv('t0.csv')
c.create_table('t0', t0, gpu=False)
c.create_table('t0_gpu', t0, gpu=True)
print('CPU Result:')
result1= c.sql("SELECT ( CASE ((t0.c0) ||(t0.c0)) WHEN ( CASE ((t0.c0) ||(t0.c0)) WHEN '' THEN t0.c0 END ) THEN '' ELSE (('.8Kb') ||(t0.c0)) END ) FROM t0").compute()
print(result1)
print('GPU Result:')
result2= c.sql("SELECT ( CASE ((t0_gpu.c0) ||(t0_gpu.c0)) WHEN ( CASE ((t0_gpu.c0) ||(t0_gpu.c0)) WHEN '' THEN t0_gpu.c0 END ) THEN '' ELSE (('.8Kb') ||(t0_gpu.c0)) END ) FROM t0_gpu").compute()
print(result2)
t0.csv:
c0,
'',
Result:
INFO:numba.cuda.cudadrv.driver:init
CPU Result:
CASE t0.c0 || t0.c0 WHEN CASE t0.c0 || t0.c0 WHEN Utf8("") THEN t0.c0 END THEN Utf8("") ELSE Utf8(".8Kb") || t0.c0 END
0 .8Kb''
GPU Result:
CASE t0_gpu.c0 || t0_gpu.c0 WHEN CASE t0_gpu.c0 || t0_gpu.c0 WHEN Utf8("") THEN t0_gpu.c0 END THEN Utf8("") ELSE Utf8(".8Kb") || t0_gpu.c0 END
0
What happened:
SELECT (CASE \ WHEN (CASE \ WHEN \ THEN \ END) THEN \ ELSE \ END) FROM \ brings different results, when using CPU and GPU execution.
- dask-sql version: 2023.6.0
- Python version: Python 3.10.11
- Operating System: Ubuntu22.04
- Install method (conda, pip, source): Docker deploy by https://hub.docker.com/layers/rapidsai/rapidsai-dev/23.06-cuda11.8-devel-ubuntu22.04-py3.10/images/sha256-cfbb61fdf7227b090a435a2e758114f3f1c31872ed8dbd96e5e564bb5fd184a7?context=explore
- © Githubissues.
- Githubissues is a development platform for aggregating issues.
What you expected to happen:
It is the same result, when using CPU and GPU execution.
Minimal Complete Verifiable Example:
t0.csv:
Result:
Anything else we need to know?:
Environment: