You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ji...@apache.org on 2019/06/20 13:20:51 UTC
[flink] branch master updated: [FLINK-12910][hotfix][python][tests]
Fix the Python catalog test failure caused by FLINK-12877
This is an automated email from the ASF dual-hosted git repository.
jincheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 7d8869d [FLINK-12910][hotfix][python][tests] Fix the Python catalog test failure caused by FLINK-12877
7d8869d is described below
commit 7d8869d7b1a0d08b3ac0a4e3e5bbe23b41b2cb57
Author: Dian Fu <fu...@alibaba-inc.com>
AuthorDate: Thu Jun 20 20:17:47 2019 +0800
[FLINK-12910][hotfix][python][tests] Fix the Python catalog test failure caused by FLINK-12877
This closes #8807
---
flink-python/pyflink/table/catalog.py | 25 ++----------------------
flink-python/pyflink/table/tests/test_catalog.py | 4 ++--
2 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/flink-python/pyflink/table/catalog.py b/flink-python/pyflink/table/catalog.py
index 0684d23..efa15f0 100644
--- a/flink-python/pyflink/table/catalog.py
+++ b/flink-python/pyflink/table/catalog.py
@@ -23,7 +23,7 @@ from pyflink.table.table_schema import TableSchema
__all__ = ['Catalog', 'CatalogDatabase', 'CatalogBaseTable', 'CatalogPartition', 'CatalogFunction',
'ObjectPath', 'CatalogPartitionSpec', 'CatalogTableStatistics',
- 'CatalogColumnStatistics', 'HiveCatalog', 'HiveCatalogDatabase', 'HiveCatalogFunction',
+ 'CatalogColumnStatistics', 'HiveCatalog', 'HiveCatalogFunction',
'HiveCatalogPartition', 'HiveCatalogTable', 'HiveCatalogView']
@@ -557,11 +557,7 @@ class CatalogDatabase(object):
@staticmethod
def _get(j_catalog_database):
- if j_catalog_database.getClass().getName() == \
- "org.apache.flink.table.catalog.hive.HiveCatalogDatabase":
- return HiveCatalogDatabase(j_hive_catalog_database=j_catalog_database)
- else:
- return CatalogDatabase(j_catalog_database)
+ return CatalogDatabase(j_catalog_database)
def get_properties(self):
"""
@@ -981,23 +977,6 @@ class HiveCatalog(Catalog):
super(HiveCatalog, self).__init__(j_hive_catalog)
-class HiveCatalogDatabase(CatalogDatabase):
- """
- A catalog database implementation for Hive.
- """
-
- def __int__(self, properties, location=None, comment=None, j_hive_catalog_database=None):
- gateway = get_gateway()
- if j_hive_catalog_database is None:
- j_hive_catalog_database = \
- gateway.jvm.org.apache.flink.table.catalog.hive.HiveCatalogDatabase(
- properties, location, comment)
- super(HiveCatalogDatabase, self).__init__(j_hive_catalog_database)
-
- def get_location(self):
- return self._j_catalog_database.getLocation()
-
-
class HiveCatalogFunction(CatalogFunction):
"""
A catalog function implementation for Hive.
diff --git a/flink-python/pyflink/table/tests/test_catalog.py b/flink-python/pyflink/table/tests/test_catalog.py
index 226ee68..2cb0624 100644
--- a/flink-python/pyflink/table/tests/test_catalog.py
+++ b/flink-python/pyflink/table/tests/test_catalog.py
@@ -75,13 +75,13 @@ class CatalogTestBase(PyFlinkTestCase):
@staticmethod
def create_db():
gateway = get_gateway()
- j_database = gateway.jvm.GenericCatalogDatabase({"k1": "v1"}, CatalogTestBase.test_comment)
+ j_database = gateway.jvm.CatalogDatabaseImpl({"k1": "v1"}, CatalogTestBase.test_comment)
return CatalogDatabase(j_database)
@staticmethod
def create_another_db():
gateway = get_gateway()
- j_database = gateway.jvm.GenericCatalogDatabase({"k2": "v2"}, "this is another database.")
+ j_database = gateway.jvm.CatalogDatabaseImpl({"k2": "v2"}, "this is another database.")
return CatalogDatabase(j_database)
@staticmethod