open-metadata / OpenMetadata

OpenMetadata is a unified metadata platform for data discovery, data observability, and data governance powered by a central metadata repository, in-depth column level lineage, and seamless team collaboration.
https://open-metadata.org
Apache License 2.0
5.58k stars 1.05k forks source link

Oracle Stored Procedures Entities are not displayed on the UI Table lineage #15419

Closed nqvuong1998 closed 8 months ago

nqvuong1998 commented 8 months ago

Affected module

Describe the bug

CREATE TABLE HCVN_HANBUINB.A ( id NUMBER, name VARCHAR2(50), age NUMBER ); INSERT INTO HCVN_HANBUINB.A (id, name, age) VALUES (1, 'John', 25);

CREATE TABLE HCVN_HANBUINB.B AS SELECT * FROM HCVN_HANBUINB.A WHERE 1 = 0; INSERT INTO HCVN_HANBUINB.B (id, name, age) VALUES (3, 'Bob', 22);

CREATE OR REPLACE PROCEDURE CopyDataFromBtoA AS BEGIN INSERT INTO HCVN_HANBUINB.A (id, name, age) SELECT id, name, age FROM HCVN_HANBUINB.B; COMMIT; END CopyDataFromBtoA;

BEGIN CopyDataFromBtoA; END;

To Reproduce

Expected behavior

image

Version:

nqvuong1998 commented 8 months ago

cc @ayush-shah @NiharDoshi99

ayush-shah commented 8 months ago

@nqvuong1998 please share if the table already exists in OpenMetadata and share the screenshot of the lineage from that stored procedure itself, Thanks

nqvuong1998 commented 8 months ago

Hi @ayush-shah ,

image

image

nqvuong1998 commented 8 months ago

Hi @ayush-shah ,

Several inquiries regarding Oracle Stored Procedures (SP) include:

  1. Why doesn't OM utilize SP Definition in DBA_SOURCE to extract table lineage and attach edge information?
  2. Why doesn't OM utilize UPPER(sql_text) when filtering SP data? For instance: sql_text LIKE 'CALL%%'.
  3. When dealing with Oracle SP, there are various ways to trigger SP (CALL, BEGIN ... END). Does OM require additional conditions for filtering SP data?
  4. In the Oracle gv$sql table, it appears that Oracle is not tracking the entire query history, potentially causing OM to miss some lineage.
ayush-shah commented 8 months ago

@nqvuong1998 we can see some similarities with below ticket, please refer to the below https://github.com/open-metadata/OpenMetadata/issues/15062

ayush-shah commented 8 months ago

@nqvuong1998

  1. we use DBA_SOURCE itself to fetch the stored procedure, parse that and create an edge info from that. 2nd, 3rd and 4th we will investigate the same, also, if you want to contribute, do let us know, and we will help you guide around the same 🙏