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

Fixes #17085: Update Oracle count & unique count function to handle HexByteString/Blob types #17596

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

ayush-shah
Copy link
Member

Describe your changes:

Fixes #17085

I worked on Updating Oracle count & unique count function to handle HexByteString/Blob types

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Comment on lines 57 to 66
def _unique_count_query_oracle(col, session, sample):
count_fn = col
if isinstance(col.type, HexByteString):
count_fn = CountFn(col)
return (
session.query(func.count(count_fn))
.select_from(sample)
.group_by(count_fn)
.having(func.count(count_fn) == 1)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be handled in the CountFn itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

func.count(col) gives -> 'count(propagated_msgid)'

whereas when i pass in the Countfn with custom logic for HexByteString i.e. blob as we have mapped it internally, then we get the count as count(DBMS_LOB.GETLENGTH(propagated_msgid))

we have handled it in CountFn, unique count though doesn't take CountFn, rather it uses func.count

@ayush-shah ayush-shah requested a review from TeddyCr September 5, 2024 09:17
Copy link

sonarqubecloud bot commented Sep 5, 2024

@ayush-shah ayush-shah merged commit b2f21fa into main Sep 6, 2024
15 of 16 checks passed
@ayush-shah ayush-shah deleted the issue-17085 branch September 6, 2024 07:12
hurongliang added a commit to hurongliang/OpenMetadata that referenced this pull request Sep 6, 2024
* main:
  Fixes open-metadata#17085: Update Oracle count & unique count function to handle HexByteString/Blob types (open-metadata#17596)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ingestion safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Profiler Workflow doesn't support Oracle Blob Type
2 participants