heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.93k stars 445 forks source link

Error "Exception: DDL or update DML are not unsupported by current thrift API" when running on GPU #657

Open honhantri1995 opened 3 years ago

honhantri1995 commented 3 years ago

Hi guys,

I execute simple SQL commands (such as create table, select, ...) with the API sql_execute_df (which is generated by Thrift C++, and clearly defined in omnisci_db/gen-cpp/OmniSci.h) on GPU. But I get the following error: "Exception: DDL or update DML are not unsupported by current thrift API"

The parameters are:

Everything is absolutely good when I run on CPU (use API sql_execute), but when I switch to GPU (use API sql_execute_df ), the above error occurs.

My GPU is: NVidia Geforce RTX 2080

I installed CUDA, and run "nvidia-smi" succeeded.

The Thrift version is 0.14.0 (almost latest)

How I generate C++ code by Thrift for Omnisci? I run: thrift -r --gen cpp omnisci.thrift

Is that Thrift for Omnisci have not supported SQL query on GPU at the moment?

Thanks a lot!

cdessanti commented 3 years ago

Hi,

we use thrift to run queries on GPU (or CPU) using arrow (or using other kind of DF) without any issue on languages like python, Java.

I believe C++ thift API is used on most of our utility like omnisql, and looking at the code is see the call to run queries and DDLs is wrapped on a method called thrift_with_retry(kSQL, context, query.c_str());

Following the code I found this call in ThriftWithRetry.h

            context.client.sql_execute(
                context.query_return, context.session, arg, true, "", -1, -1);

In my opinion you should

1) validate your environments being sure the database is able to use the GPU to run queries 2) try with the sql_execute basic method 3) and the switch to arrow one

for the point 1 one you can connect to the database using omnisql and run an axplain of a simple query like that explain select c1,count(*) from t1 group by 1;

you should get something like IR for the GPU and not IR for the CPU

which version of datbase/nvidia driver are you on?