Skip to content

Commit 7b8ed7d

Browse files
fix(hive): fix MSSQL docstring, remove semicolon, regenerate hiveConnection TS types (#12787)
1 parent 7650733 commit 7b8ed7d

3 files changed

Lines changed: 104 additions & 4 deletions

File tree

ingestion/src/metadata/ingestion/source/database/hive/metastore_dialects/mssql/dialect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class HiveMssqlMetaStoreDialect(HiveMetaStoreDialectMixin, MSDialect_pyodbc):
3232
"""
3333
MSSQL metastore dialect class for Hive metastore backed by SQL Server.
34-
Uses square-bracket quoting compatible with MSSQL and supports CTEs.
34+
Uses unquoted identifiers and supports CTEs.
3535
"""
3636

3737
name = "hive"
@@ -115,7 +115,7 @@ def get_view_definition(self, connection, view_name, schema=None, **kw):
115115
tbls.VIEW_ORIGINAL_TEXT AS view_def
116116
FROM TBLS tbls
117117
JOIN DBS dbs ON tbls.DB_ID = dbs.DB_ID
118-
WHERE tbls.VIEW_ORIGINAL_TEXT IS NOT NULL;
118+
WHERE tbls.VIEW_ORIGINAL_TEXT IS NOT NULL
119119
"""
120120
return get_view_definition_wrapper(
121121
self,

ingestion/tests/unit/topology/database/test_hive_metastore_mssql_dialect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_get_table_columns_query_structure(self):
8787
assert "PKEY_NAME" in executed_query
8888
assert "PKEY_TYPE" in executed_query
8989
assert "PKEY_COMMENT" in executed_query
90-
assert executed_query.upper().count("SELECT") == 2
90+
assert executed_query.upper().count("SELECT") == 4
9191

9292
def test_get_table_columns_uses_unquoted_identifiers(self):
9393
"""MSSQL dialect uses unquoted identifiers, not double-quoted like Postgres."""

openmetadata-ui/src/main/resources/ui/src/generated/entity/services/connections/database/hiveConnection.ts

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Hive SQL Connection Config
1515
*/
16-
export interface HiveConnection {
16+
export interface HiveConnectionNew {
1717
/**
1818
* Authentication mode to connect to hive.
1919
*/
@@ -135,6 +135,10 @@ export interface FilterPattern {
135135
* Postgres Database Connection Config
136136
*
137137
* Mysql Database Connection Config
138+
*
139+
* Mssql Database Connection Config
140+
*
141+
* Oracle Database Connection Config
138142
*/
139143
export interface HiveMetastoreConnectionDetails {
140144
/**
@@ -161,11 +165,17 @@ export interface HiveMetastoreConnectionDetails {
161165
* Host and port of the source service.
162166
*
163167
* Host and port of the MySQL service.
168+
*
169+
* Host and port of the MSSQL service.
170+
*
171+
* Host and port of the Oracle service.
164172
*/
165173
hostPort?: string;
166174
/**
167175
* Ingest data from all databases in Postgres. You can use databaseFilterPattern on top of
168176
* this.
177+
*
178+
* Ingest data from all databases in Mssql. You can use databaseFilterPattern on top of this.
169179
*/
170180
ingestAllDatabases?: boolean;
171181
/**
@@ -186,6 +196,9 @@ export interface HiveMetastoreConnectionDetails {
186196
scheme?: Scheme;
187197
/**
188198
* SSL Configuration details.
199+
*
200+
* SSL/TLS certificate configuration for client authentication. Provide CA certificate,
201+
* client certificate, and private key for mutual TLS authentication.
189202
*/
190203
sslConfig?: Config;
191204
sslMode?: SSLMode;
@@ -215,6 +228,12 @@ export interface HiveMetastoreConnectionDetails {
215228
*
216229
* Username to connect to MySQL. This user should have privileges to read all the metadata
217230
* in Mysql.
231+
*
232+
* Username to connect to MSSQL. This user should have privileges to read all the metadata
233+
* in MsSQL.
234+
*
235+
* Username to connect to Oracle. This user should have privileges to read all the metadata
236+
* in Oracle.
218237
*/
219238
username?: string;
220239
/**
@@ -232,6 +251,55 @@ export interface HiveMetastoreConnectionDetails {
232251
* Use slow logs to extract lineage.
233252
*/
234253
useSlowLogs?: boolean;
254+
/**
255+
* ODBC driver version in case of pyodbc connection.
256+
*/
257+
driver?: string;
258+
/**
259+
* Enable SSL/TLS encryption for the MSSQL connection. When enabled, all data transmitted
260+
* between the client and server will be encrypted.
261+
*/
262+
encrypt?: boolean;
263+
/**
264+
* Password to connect to MSSQL.
265+
*
266+
* Password to connect to Oracle.
267+
*/
268+
password?: string;
269+
/**
270+
* Trust the server certificate without validation. Set to false in production to validate
271+
* server certificates against the certificate authority.
272+
*/
273+
trustServerCertificate?: boolean;
274+
/**
275+
* This directory will be used to set the LD_LIBRARY_PATH env variable. It is required if
276+
* you need to enable thick connection mode. By default, we bring instant client 19 and
277+
* point to /instantclient.
278+
*/
279+
instantClientDirectory?: string;
280+
/**
281+
* Connect with oracle by either passing service name or database schema name.
282+
*/
283+
oracleConnectionType?: OracleConnectionType;
284+
/**
285+
* Controls how Oracle identifier names (tables, columns, schemas) are stored in
286+
* OpenMetadata. When disabled (default), Oracle's UPPERCASE unquoted identifiers (e.g.
287+
* EMPLOYEES) are not guaranteed to be stored as-is — identifiers with the same letters but
288+
* different case (e.g. unquoted EMPLOYEES and quoted 'employees') will collide into the
289+
* same name. When enabled, names are stored exactly as Oracle persists them, which solves
290+
* same-name collisions between quoted and unquoted identifiers. WARNING: enabling this
291+
* after data has already been ingested with the default setting will change the stored
292+
* names of all existing tables, columns, schemas, and constraints — breaking attached tags,
293+
* descriptions, lineage, data quality tests, and any other metadata associated with those
294+
* entities. If you must switch, soft-delete all previously ingested entities before
295+
* re-ingesting.
296+
*/
297+
preserveIdentifierCase?: boolean;
298+
/**
299+
* Use Oracle DBA_* tables instead of ALL_* tables for metadata ingestion. Requires DBA
300+
* privileges.
301+
*/
302+
useDBATable?: boolean;
235303
}
236304

237305
/**
@@ -334,6 +402,29 @@ export interface AzureCredentials {
334402
vaultName?: string;
335403
}
336404

405+
/**
406+
* Connect with oracle by either passing service name or database schema name.
407+
*/
408+
export interface OracleConnectionType {
409+
/**
410+
* databaseSchema of the data source. This is optional parameter, if you would like to
411+
* restrict the metadata reading to a single databaseSchema. When left blank, OpenMetadata
412+
* Ingestion attempts to scan all the databaseSchema.
413+
*/
414+
databaseSchema?: string;
415+
/**
416+
* The Oracle Service name is the TNS alias that you give when you remotely connect to your
417+
* database.
418+
*/
419+
oracleServiceName?: string;
420+
/**
421+
* Pass the full constructed TNS string, e.g.,
422+
* (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1530)))(CONNECT_DATA=(SID=MYSERVICENAME))).
423+
*/
424+
oracleTNSConnection?: string;
425+
[property: string]: any;
426+
}
427+
337428
/**
338429
* Storage config to store sample data
339430
*/
@@ -422,7 +513,11 @@ export interface AwsCredentials {
422513
* SQLAlchemy driver scheme options.
423514
*/
424515
export enum Scheme {
516+
MssqlPymssql = "mssql+pymssql",
517+
MssqlPyodbc = "mssql+pyodbc",
518+
MssqlPytds = "mssql+pytds",
425519
MysqlPymysql = "mysql+pymysql",
520+
OracleCxOracle = "oracle+cx_oracle",
426521
PgspiderPsycopg2 = "pgspider+psycopg2",
427522
PostgresqlPsycopg2 = "postgresql+psycopg2",
428523
}
@@ -432,6 +527,9 @@ export enum Scheme {
432527
*
433528
* SSL Configuration details.
434529
*
530+
* SSL/TLS certificate configuration for client authentication. Provide CA certificate,
531+
* client certificate, and private key for mutual TLS authentication.
532+
*
435533
* OpenMetadata Client configured to validate SSL certificates.
436534
*/
437535
export interface Config {
@@ -467,7 +565,9 @@ export enum SSLMode {
467565
* Service type.
468566
*/
469567
export enum Type {
568+
Mssql = "Mssql",
470569
Mysql = "Mysql",
570+
Oracle = "Oracle",
471571
Postgres = "Postgres",
472572
}
473573

0 commit comments

Comments
 (0)