Skip to content
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

feat(ingest/snowflake): support for more operation types #8158

Merged

Conversation

mayurinehate
Copy link
Collaborator

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jun 1, 2023
Copy link
Contributor

@treff7es treff7es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@treff7es treff7es merged commit fb44cbd into datahub-project:master Jun 1, 2023
Copy link
Collaborator

@asikowitz asikowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw this just got merged, but a couple question

Comment on lines +46 to +48
"MERGE": OperationTypeClass.CUSTOM,
"COPY": OperationTypeClass.CUSTOM,
"TRUNCATE_TABLE": OperationTypeClass.CUSTOM,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that putting CUSTOM allows us to show the customOperationType, but for other sources we try to label these:

(unity)

    QueryStatementType.COPY: OperationTypeClass.INSERT,
    QueryStatementType.UPDATE: OperationTypeClass.UPDATE,
    QueryStatementType.MERGE: OperationTypeClass.UPDATE,
    QueryStatementType.DELETE: OperationTypeClass.DELETE,
    QueryStatementType.TRUNCATE: OperationTypeClass.DELETE,

(bigquery)

    "MERGE": OperationTypeClass.UPDATE,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MERGE is in fact UPDATE and/or DELETE and/or INSERT, so I was hesitant to mark it as UPDATE. CUSTOM operationType is not great to use. cc: @jjoyce0510 . We could add more operation types in model maybe ? I am proposing addition of more operation types to - MERGE, COPY, TRUNCATE respectively. Does that make sense ?

Comment on lines +382 to +384
customOperationType=query_type
if operation_type is OperationTypeClass.CUSTOM
else None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there harm in passing this if the operation type class is not CUSTOM, for more info? I know we don't do this elsewhere in the code but could start here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I thought that myself as well. Then customOperationType just behaves more like "nativeOperationType" . cc - @jjoyce0510 - can you confirm this one as well please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants