我在cdsw中使用impyla和python查询hdfs中的数据并使用它。问题是有时要获取我必须进入的所有数据,然后手动单击hue中的“使所有元数据无效并重建索引”按钮。有没有一种方法可以在工作台中使用库或python代码来实现这一点?
fkaflof61#
我想你是在用这样的东西连接到 impala 通过 impyla ... 尝试执行 invalidate metadata <table_name> 命令
impala
impyla
invalidate metadata <table_name>
from impala.dbapi import connectconn = connect(host='my.host.com', port=21050)cursor = conn.cursor()cursor.execute('INVALIDATE METADATA mytable') # run thiscursor.execute('SELECT * FROM mytable LIMIT 100')print cursor.description # prints the result set's schemaresults = cursor.fetchall()
from impala.dbapi import connect
conn = connect(host='my.host.com', port=21050)
cursor = conn.cursor()
cursor.execute('INVALIDATE METADATA mytable') # run this
cursor.execute('SELECT * FROM mytable LIMIT 100')
print cursor.description # prints the result set's schema
results = cursor.fetchall()
1条答案
按热度按时间fkaflof61#
我想你是在用这样的东西连接到
impala
通过impyla
... 尝试执行invalidate metadata <table_name>
命令