PyHive icon indicating copy to clipboard operation
PyHive copied to clipboard

Execute multiple queries in single execute command

Open sjd-lab opened this issue 7 years ago • 8 comments

Is it possible to execute multiple hql's like 'CREATE TABLE TABLE1 (ITEM_KEY BIGINT );CREATE TABLE TABLE2 (ITEM_NAME BIGINT );'.

Sample code

from pyhive import hive
conn = hive.Connection(host=host
                       , port=port, username=user
                       , password=passwd
                       , auth=auth)
cursor = conn.cursor()
query= 'CREATE TABLE TABLE1 (ITEM_KEY BIGINT );CREATE TABLE TABLE2 (ITEM_NAME BIGINT );'. 
cursor.execute(query)

sjd-lab avatar Sep 03 '18 08:09 sjd-lab

+1, Same question

77QingLiu avatar Oct 28 '18 02:10 77QingLiu

Same question

zx06 avatar Nov 14 '18 08:11 zx06

Same question +1

BingyanZen avatar Apr 16 '19 17:04 BingyanZen

+1

MichelleArk avatar May 02 '19 20:05 MichelleArk

+1

kelleyrw avatar Mar 19 '20 21:03 kelleyrw

It's fine if this is not allowed. Can someone in the know comment?

kelleyrw avatar Mar 19 '20 21:03 kelleyrw

+1

c-hui avatar Dec 23 '20 04:12 c-hui

+1

NadimYounes avatar Feb 24 '21 22:02 NadimYounes