1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      如何使用PythonImpyla客戶端連接Hive和Impala

      這篇文章主要介紹了如何使用Python Impyla客戶端連接Hive和Impala,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

      創(chuàng)新互聯(lián)公司堅(jiān)信:善待客戶,將會(huì)成為終身客戶。我們能堅(jiān)持多年,是因?yàn)槲覀円恢笨芍档眯刨嚒N覀儚牟缓鲇瞥踉L客戶,我們用心做好本職工作,不忘初心,方得始終。十年網(wǎng)站建設(shè)經(jīng)驗(yàn)創(chuàng)新互聯(lián)公司是成都老牌網(wǎng)站營銷服務(wù)商,為您提供網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、網(wǎng)站設(shè)計(jì)、H5場(chǎng)景定制、網(wǎng)站制作、成都品牌網(wǎng)站建設(shè)、小程序設(shè)計(jì)服務(wù),給眾多知名企業(yè)提供過好品質(zhì)的建站服務(wù)。

      使用hive模塊

      1. pip install sasl

      2. pip install thrift

      3. pip install thrift-sasl

      4. pip install PyHive

      1. [root@ip-172-31-40-242 ~]# more testpyhive.py

      2. from pyhive import hive

      3. conn = hive.Connection(host='xxxxxxx', port=10000, database='collection',username='')

      4. cursor=conn.cursor()

      5. cursor.execute('select * from tb_partition limit 10')

      6. for result in cursor.fetchall():

      7.     print result



      [root@ip-172-31-40-242 ~]# python testpyhive.py 
      (u'1', u'2', u'201707')
      (u'1', u'2', u'201707')
      (u'123', None, u'201709')
      (u'123', u'456', u'201709')
      (u'45678', u'456', u'201709')
      (u'123', None, u'201709')
      (u'123', u'456', u'201709')
      (u'45678', u'456', u'201709')
      (u'123', None, u'201709')
      (u'123', u'456', u'201709')


      官方API: https://pypi.org/project/PyHive/

      如何使用Python Impyla客戶端連接Hive和Impala
      # -*- coding:utf-8 -*-
      from impala.dbapi import connect
      conn = connect(host='172.31.46.109',port=10000,database='collection',auth_mechanism='PLAIN')
      print(conn)
      cursor = conn.cursor()
      #
      param = '''SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
      SET hive.support.concurrency=true;
      '''
      cursor.execute(param)
      cursor.execute('SELECT uid FROM redefine_collection where uid=4028 limit 10')
      print cursor.description  # prints the result set's schema
      results = cursor.fetchall()
      print results
      #
      # Python連接Impala(ImpalaTest.py)
      #
      # from impala.dbapi importconnect
      #
      # conn = connect(host='ip-172-31-26-80.ap-southeast-1.compute.internal',port=21050)
      #
      # print(conn)
      #
      # cursor = conn.cursor()
      #
      # cursor.execute('show databases')
      #
      # print cursor.description  # prints the result set's schema
      #
      # results = cursor.fetchall()
      #
      # print(results)
      #
      # cursor.execute('SELECT * FROM test limit 10')
      #
      # print cursor.description  # prints the result set's schema
      #
      # results = cursor.fetchall()
      #
      # print(results)

      感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“如何使用Python Impyla客戶端連接Hive和Impala”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來學(xué)習(xí)!


      網(wǎng)站題目:如何使用PythonImpyla客戶端連接Hive和Impala
      當(dāng)前URL:http://www.ef60e0e.cn/article/gdggih.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        子长县| 湘阴县| 黄梅县| 内乡县| 潮安县| 涟水县| 禹城市| 佳木斯市| 龙游县| 剑河县| 简阳市| 曲松县| 新民市| 宁国市| 渑池县| 江华| 大埔区| 巩留县| 楚雄市| 秭归县| 桦甸市| 富顺县| 东海县| 吴堡县| 石棉县| 正蓝旗| 义马市| 达尔| 黄梅县| 革吉县| 黑山县| 南乐县| 和平县| 玛多县| 麻城市| 红原县| 资中县| 金山区| 措勤县| 牡丹江市| 秦皇岛市|