Skip to content

Commit

Permalink
[KYUUBI apache#6281][PY] Enable hive test in python client
Browse files Browse the repository at this point in the history
# 🔍 Description
## Issue References 🔗

This pull request enables running hive test cases in python client, however there's one trivial case not covered yet and two others require a proper container setup

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️
Hive test disabled in apache#6343

#### Behavior With This Pull Request 🎉
Can cover hive test cases

#### Related Unit Tests
No

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes apache#6381 from sudohainguyen/ci/hive.

Closes apache#6281

a861382 [Harry] [KYUUBI apache#6281][PY] Enable hive test in python client

Authored-by: Harry <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
sudohainguyen authored and pan3793 committed May 15, 2024
1 parent bc394a9 commit 06af125
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions python/docker/hadoop-hive.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ HIVE_SITE_CONF_javax_jdo_option_ConnectionPassword=hive
HIVE_SITE_CONF_datanucleus_autoCreateSchema=false
HIVE_SITE_CONF_hive_metastore_uris=thrift://hive-metastore:9083
HDFS_CONF_dfs_namenode_datanode_registration_ip___hostname___check=false
HIVE_SITE_CONF_hive_strict_checks_cartesian_product=false
HIVE_SITE_CONF_hive_mapred_mode=nonstrict

CORE_CONF_fs_defaultFS=hdfs://namenode:8020
CORE_CONF_hadoop_http_staticuser_user=root
Expand Down
7 changes: 3 additions & 4 deletions python/pyhive/tests/test_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
_HOST = 'localhost'


@pytest.mark.skip(reason="Temporary disabled")
class TestHive(unittest.TestCase, DBAPITestCase):
__test__ = True

Expand Down Expand Up @@ -110,7 +109,6 @@ def test_cancel(self, cursor):
async_=True
)
self.assertEqual(cursor.poll().operationState, ttypes.TOperationState.RUNNING_STATE)
assert any('Stage' in line for line in cursor.fetch_logs())
cursor.cancel()
self.assertEqual(cursor.poll().operationState, ttypes.TOperationState.CANCELED_STATE)

Expand All @@ -136,6 +134,7 @@ def test_escape(self):
bad_str = '''`~!@#$%^&*()_+-={}[]|\\;:'",./<>?\t '''
self.run_escape_case(bad_str)

@pytest.mark.skip(reason="Currently failing")
def test_newlines(self):
"""Verify that newlines are passed through correctly"""
cursor = self.connect().cursor()
Expand All @@ -153,7 +152,7 @@ def test_no_result_set(self, cursor):
self.assertIsNone(cursor.description)
self.assertRaises(hive.ProgrammingError, cursor.fetchone)

@pytest.mark.skip
@pytest.mark.skip(reason="Need a proper setup for ldap")
def test_ldap_connection(self):
rootdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
orig_ldap = os.path.join(rootdir, 'scripts', 'conf', 'hive', 'hive-site-ldap.xml')
Expand Down Expand Up @@ -213,7 +212,7 @@ def test_custom_transport(self):
cursor.execute('SELECT * FROM one_row')
self.assertEqual(cursor.fetchall(), [(1,)])

@pytest.mark.skip
@pytest.mark.skip(reason="Need a proper setup for custom auth")
def test_custom_connection(self):
rootdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
orig_ldap = os.path.join(rootdir, 'scripts', 'conf', 'hive', 'hive-site-custom.xml')
Expand Down
1 change: 0 additions & 1 deletion python/pyhive/tests/test_sqlalchemy_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
# ]


@pytest.mark.skip(reason="Temporarily disabled")
class TestSqlAlchemyHive(unittest.TestCase, SqlAlchemyTestCase):
def create_engine(self):
return create_engine('hive://localhost:10000/default')
Expand Down

0 comments on commit 06af125

Please sign in to comment.