conn=hive.Connection(host=HOST, port=PORT, username=USERNAME,database=DATABASE) cursor = conn.cursor() #cursor.execute("INSERT INTO TABLE test_out(name,count,time) SELECT name,count(1),to_date(time) FROM test GROUP BY name,to_date(time)") cursor.execute("SELECT * FROM test") for result in cursor.fetchall(): print(result[2])