Skip to content

데이터 카탈로그 description 개선방향 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
9 tasks
seyoung4503 opened this issue Mar 6, 2025 · 4 comments · May be fixed by #29
Open
9 tasks

데이터 카탈로그 description 개선방향 #5

seyoung4503 opened this issue Mar 6, 2025 · 4 comments · May be fixed by #29
Assignees
Labels
datahub The integration point that retrieves metadata from DataHub to provide better context for query gener enhancement New feature or request

Comments

@seyoung4503
Copy link
Contributor

seyoung4503 commented Mar 6, 2025

Why

현재 상황:

  • 비즈니스 용어, 데이터 거버넌스에 따른 사용자의 질문을 처리하기에 Dummy dataset의 table, column description의 정보들이 빈약합니다.
  • Image Image
  • 서로 다른 두 table의 Field(column)에 대해서 다른 이름(metric_date, anchor_date)을 가졌지만, 같은 설명(The primary key for this table)으로 해당 field를 설명하고 있습니다.

문제점:

  • 사용자 질문에 따라 참조할 수 있는 정보가 빈약해서 질문에 대한 올바른 테이블 데이터를 가져오지 않는 문제점이 있습니다.

  • 현재 가져오는 데이터들은 테이블간의 관계(1:1, 1:N, M:N)가 포함되어 있지 않습니다.

  • 예시:

    • Image
    • Image
    • Image
    • 위의 예시에서 3개의 테이블은 올바르게 가져오나, 나머지 한 개의 테이블은 관련성이 없는 내용을 가져오고 있습니다.
    • ⋇ 위의 현재 상황을 완벽하게 나타내는 예시를 아직 찾지 못했지만, 비슷한 맥락이라 생각해 해당 예시를 첨부하였습니다. 현재 similarity_search로 찾는 문서가 무조건 4개이기에, 관련성이 없는 문서도 함께 들고오는 것 같습니다. 관련성이 없는 문서가 할루시네이션을 일으킬 가능성이 있다는 점에서 호민님께서 올려주셨던 데이터베이스와 무관한 질문 처리 및 검색 결과 구조 개선 #2 이슈와도 연관성이 있는 것 같습니다.

How

  • 해결 방안:
    • DataHub의 데이터 카탈로그로부터 비즈니스 용어 사전, 테이블 메타 데이터를 생성해 사용자 질문의 맥락에 적합한 정보를 참조할 수 있게 할 수 있습니다.

    • 계층적 구조를 갖는 상위 노드들을 만들어 관계를 명시적으로 표현하고, 이를 통해 테이블 간 JOIN에 사용할 수 있습니다.

      프로젝트에 적용한다면 table, column description을 가장 하위 노드로 두고, Table의 관계, pk, fk 정보를 함께 포함시켜 상위 노드로 추가할 수 있습니다. 상위 노드에서 pk, fk 관계를 활용해 테이블을 JOIN 하는 효율적인 쿼리를 작성할 수 있습니다. 이런 계층적 구조를 사용하여 다양한 수준에서의 정보를 얻고, 활용할 수 있습니다.

    • Table, column description이 충분한 Kaggle 데이터셋을 포함시켜 사용할 수 있습니다.

What

  • 비즈니스 용어 사전 생성
    • Column 명 빈도수에 기반한 비즈니스 용어 등록
    • Column description 또는 계층적 구조를 통해 fk(별칭)을 중복되는 내용 없이 관리
    • 비즈니스 용어 사전이 있다면, 기존의 사전 사용
  • 테이블 메타 데이터 생성
    • Table, column description, 연결 테이블 목록 데이터를 포함한 메타 데이터 생성
  • 상위 노드 생성
    • datahub_source에서 관계 정보를 가져오는 함수 정의
    • 관계있는 테이블 정보의 설명, pk, fk 간 관계 정의한 노드 생성
@ehddnr301
Copy link
Collaborator

비즈니스 용어사전 Datahub Glossary
Datahub Table relation

  • upstream, downstream

@ehddnr301 ehddnr301 added enhancement New feature or request datahub The integration point that retrieves metadata from DataHub to provide better context for query gener labels Mar 11, 2025
@seyoung4503 seyoung4503 self-assigned this Mar 19, 2025
@seyoung4503 seyoung4503 linked a pull request Mar 21, 2025 that will close this issue
4 tasks
@seyoung4503 seyoung4503 linked a pull request Mar 21, 2025 that will close this issue
4 tasks
@ehddnr301
Copy link
Collaborator

@seyoung4503 이번주내에 Datahub의 Queries라던지 Glossary부분을 제가 추가 및 보완할테니 관련해서 협업해보시죠 💪

혹은 여유가 나지 않으신다면 제가 작업해도 됩니다 🤗

Image

@ParkGyeongTae
Copy link
Contributor

너무 공감되는 이슈입니다.
각 테이블의 컬럼마다 코멘트를 달다보면, 너무 지쳐서 무의식적으로 이 이슈의 첫번째, 두번째 사진처럼 기본키 또는 외래키 컬럼에 코멘트를 사진처럼 다는 경우가 있습니다....
이렇게 코멘트를 생성하면 확실히 Lang2SQL에 취약하군여..!

@seyoung4503
Copy link
Contributor Author

@ehddnr301 저도 협업하는 게 너무 좋은 것 같습니다!!
같이 해보시면 좋을 것 같아요 ㅎㅎ 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datahub The integration point that retrieves metadata from DataHub to provide better context for query gener enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants