Open wayjjpku opened 5 years ago
You need to call cur.fetchone()
after executing the CREATE TABLE
statement.
The SSL warnings is unrelated to your issue.
Did you expect CREATE TABLE
to be executed synchronously (see also #58) or was cur.fetchonne()
only missing?
It should execute the CREATE TABLE synchronously like other database modules. currently cur.fetchone() has to be given as a workaround to run the create table statement or any other insert statements.
I agree with @subbareddydagumati in that other DB API implementations do not require cur.fetchonne()
in order to execute statements.
The folks over at Trino recently fixed this exact same issue here: https://github.com/trinodb/trino-python-client/pull/220
Could something similar be implemented in the Presto client?
At first, i ran the code as showed below, it's ok, but with warnings:
but when i run the code using create table or drop table , it comes out nothing!!!:
output:
<prestodb.client.PrestoResult at 0x4a23358>
output:
<prestodb.client.PrestoResult at 0x4a1a898>
output:
by the way, i modify the code only to let
verify=False
, when the presto platform receive code not like 'select' ,the presto system will use hive to execute the code such as create table or drop table in my company.