import sys
import os
import string
import re
import MySQLdb
#加载hive的python相关库文件;
sys.path.append('/usr/local/hive_py')
from hive_service import ThriftHive
from hive_service.ttypes import HiveServerException
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
dbname="default"
hsql="select request,count(request) as counts from cdnlog where time >= '[27/Oct/2014:10:40:00 +0800]' and time <= '[27/Oct/2014:10:49
:59 +0800]' group by request order by counts desc limit 10"