我在CDSW中使用Impyla和Python来查询HDFS中的数据并使用它。问题是有时我必须进入的所有数据,并手动点击“无效所有元数据和重建索引”按钮的色调。
有没有办法在工作台中使用库或python代码来实现这一点?
发布于 2019-08-02 12:38:38
我假设你正在使用类似这样的东西通过impyla连接到impala ...尝试执行invalidate metadata <table_name>命令
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()https://stackoverflow.com/questions/57313372
复制相似问题