我有一个复杂的配置单元查询,它的底层连接是笛卡尔积。所以我需要设置以下属性。但是当我使用pyhive执行这些属性时,它无法执行。我要求设置笛卡尔函数的属性时出错。
set1=''设置hive.strict.checks.cartesian.product=false''
set2=''设置hive.mapred.mode=strict''
def connectData(query,host,port,username):
conn = hive.Connection(host=host, port=port, username=username).cursor()
conn.execute(query)
val=conn.fetchall()
columnNames = [a[0] for a in conn.description]
df=pd.DataFrame(data=val,columns=columnNames)
return df
def settings(query,host,port,username):
conn = hive.Connection(host=host, port=port, username=username).cursor()
conn.execute(query)
settings(set1, host, port, username)
settings(set2, host, port, username)
df = connectData(query, host, port, username)
print(df)
1条答案
按热度按时间b1payxdu1#
尝试如下设置: