Skip to content

[BUG][Logic Bug] "SELECT (<column>)*(<decimal>) FROM <table>" by JDBC brings Error #1238

@qwebug

Description

@qwebug

What happened:

Using "SELECT (<column>)*(<decimal>) FROM <table>" by JDBC brings error, when using GPU. While it is able to output result, when using CPU.

However, it is the same result, when using this sql by python.

What you expected to happen:

It is the same result, when using CPU and GPU.

Minimal Complete Verifiable Example:

Query by JDBC:

DROP SCHEMA IF EXISTS database0;
CREATE SCHEMA IF NOT EXISTS database0;
USE SCHEMA database0;
CREATE TABLE t0 WITH ( location = '/tmp/t0.csv', format = 'csv', gpu = FALSE );
CREATE TABLE t0_gpu WITH ( location = '/tmp/t0.csv', format = 'csv', gpu = TRUE );

t0.csv:

c0,c1,c2,c3
'SV', ',0', '', 0.4844035702735847

SQL:

SELECT (t0.c3)*(1.0) FROM t0;

Result:

 t0_testtable.c3 * Float64(1) 
------------------------------
           0.4844035702735847 
(1 row)

SQL:

SELECT (t0_gpu.c3)*(1.0) FROM t0_gpu;

Result:

Query 48599789-98c1-46ad-9788-bb42251ba3ad failed: Plan("Utf8 * Float64 can't be evaluated because there isn't a common type to coerce the types to")

Query by python:

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

c = Context()

df = pd.DataFrame({
    'c0': ['SV'],
    'c1': [',0'],
    'c2': [''],
    'c3': [0.4844035702735847],
})
t0 = dd.from_pandas(df, npartitions=1)

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

print('CPU Result:')
result1= c.sql("SELECT (t0_testtable.c3)*(1.0) FROM t0_testtable").compute()
print(result1)

print('GPU Result:')
result2= c.sql("SELECT (t0_testtable_gpu.c3)*(1.0) FROM t0_testtable_gpu").compute()
print(result2)

Result:

INFO:numba.cuda.cudadrv.driver:init
CPU Result:
   t0_testtable.c3 * Float64(1)
0                      0.484404
GPU Result:
   t0_testtable_gpu.c3 * Float64(1)
0                          0.484404

Anything else we need to know?:

Environment:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAwaiting triage by a dask-sql maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions