dask-sql icon indicating copy to clipboard operation
dask-sql copied to clipboard

[BUG] [GPU Logic Bug] SELECT (CASE <DATE> WHEN <DATE> THEN <DATE> END) FROM <table> brings Error

Open qwebug opened this issue 1 year ago • 1 comments

What happened:

SELECT (CASE <DATE> WHEN <DATE> THEN <DATE> END) FROM <table> 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()

df0 = pd.DataFrame({
    'c0': [True],
})
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 DATE '2005-05-21' WHEN DATE '1981-07-19' THEN DATE '2015-04-07' END ) FROM t0").compute()
print(result1)

print('GPU Result:')
result2= c.sql("SELECT (CASE DATE '2005-05-21' WHEN DATE '1981-07-19' THEN DATE '2015-04-07' END ) FROM t0_gpu").compute()
print(result2)

Result:

INFO:numba.cuda.cudadrv.driver:init
CPU Result:
  CASE Utf8("2005-05-21") WHEN Utf8("1981-07-19") THEN Utf8("2015-04-07") END
0                                                NaT                         
GPU Result:
  CASE Utf8("2005-05-21") WHEN Utf8("1981-07-19") THEN Utf8("2015-04-07") END
0                                               <NA>        

Anything else we need to know?:

Environment:

qwebug avatar Jun 05 '24 20:06 qwebug

Dask-sql version 2024.3.0 has fixed this issue, thanks for your report.

griffith-maker avatar Oct 29 '24 11:10 griffith-maker