File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/databricks/labs/ucx/hive_metastore Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 4
4
from dataclasses import dataclass , replace
5
5
from functools import cached_property
6
6
from typing import ClassVar
7
- from packaging .version import Version , InvalidVersion
8
7
9
8
10
9
from databricks .labs .blueprint .installation import Installation
@@ -113,16 +112,15 @@ def _external_hms(self) -> ExternalHmsInfo | None:
113
112
if not jdbc_url :
114
113
logger .info ('JDBC URL not found' )
115
114
return None
116
- version_value = self ._get_value_from_config_key (spark_config , 'spark.sql.hive.metastore.version' )
117
- if not version_value :
115
+ version = self ._get_value_from_config_key (spark_config , 'spark.sql.hive.metastore.version' )
116
+ if not version :
118
117
logger .info ('Hive Metastore version not found' )
119
118
return None
120
- try :
121
- version = Version (version_value )
122
- except InvalidVersion :
123
- logger .info ('Hive Metastore version is not valid' )
119
+ major_minor_match = re .match (r'(^\d+\.\d+)' , version )
120
+ if not major_minor_match :
121
+ logger .info (f'Wrong Hive Metastore Database Version Format: { version } ' )
124
122
return None
125
- major_minor_version = f" { version . major } . { version . minor } "
123
+ major_minor_version = major_minor_match . group ( 1 )
126
124
external_hms = replace (self ._split_jdbc_url (jdbc_url ), version = major_minor_version )
127
125
supported_versions = self .supported_database_versions .get (external_hms .database_type )
128
126
if not supported_versions :
You can’t perform that action at this time.
0 commit comments