You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/09/04 13:42:52 UTC

[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #3394: [DOCS] [Subtask] [#3039] Add PyHive docs

pan3793 commented on code in PR #3394:
URL: https://github.com/apache/incubator-kyuubi/pull/3394#discussion_r962316726


##########
docs/client/python/pyhive.md:
##########
@@ -0,0 +1,70 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+
+# PyHive
+
+[PyHive](https://github.com/dropbox/PyHive) is a collection of Python DB-API and SQLAlchemy interfaces for Hive. PyHive is able to connect with Kyuubi server as Kyuubi server supports serving in thrift protocol as HiveServer2.
+
+PyHive is now marked as [no-longer maintained](https://github.com/dropbox/PyHive/commit/d199a1bd55c656b5c28d0d62f2d3f2e6c9a82a54) and staying on HiveServer2 Thrift bindings v11 which is compatible with Kyuubi server.
+
+## Requirements
+PyHive works with Python 2.7 / Python 3. Install PyHive via pip for the Hive interface.
+
+```
+pip install 'pyhive[hive]'
+```
+
+## Usage
+Use Kyuubi server's host and thrift protocol port to connect with.
+
+For further information about usages and features, eg. DB-API async fetching, using in SQLAlchemy, please refer to [project homepage](https://github.com/dropbox/PyHive).
+
+### DB-API
+
+```python
+from pyhive import hive
+cursor = hive.connect(host=kyuubi_host,port=10009).cursor()
+cursor.execute('SELECT * FROM my_awesome_data LIMIT 10')
+print cursor.fetchone()
+print cursor.fetchall()

Review Comment:
   python2 is EOL, let's use python3 syntax in demo code



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org