Randomization of AutoClassifier Sample Data
I am working with self-hosted OpenMetadata (OSS) v1.7.0. It seems that if the Profiler Settings for a table are kept unchanged (i.e., Percentage based sampling and 100% of all values), the sample data extracted via the AutoClassifier is deterministic and not randomized. However, Changing "Percentage" to "Rows" and providing the same or a larger number of rows than in the dataset seems to randomize the extracted sample data. So does providing any value other than 100 for the Percentage based sampling.
Steps to Reproduce: I have a simple Parquet file stored on a MinIO bucket that only has one column with rows that are enumerated 1-100. A corresponding table has been created on Trino. On OpenMetadata, I have created and configured a Trino connector and ran all the agents. When keeping the default profiler settings for the table (i.e., PERCENTAGE 100%) but altering the sample data size (5 rows in this case) and running the AutoClassifier, the sample data is always the rows with values 1-5. No matter how many times it gets executed. However, by editing the profiler settings to a lower percentage or changing the sample method to Row Count (yet still including all rows (i.e., 100 rows)), the extracted sample data is indeed randomized. Restoring settings to Percentage 100% then re-running the AutoClassifier yields the values 1-5 once again.
Hi! Are there any contributors working on this, otherwise I would like to take this up!
@leafoffaith we can definitely assign it to you.
hey @leafoffaith are you still interested in working on this?
hey! sorry, I missed the notification. I would like to work on this, yes
Hi! Is Leafooffaith still handling this? If not, I’d like to take it up.
@lucifervb2248 we have not had any PR yet, are you interested?
Thank you @KarimTZiad for the request, there is good interest in adding it. In the meantime, the best way to keep track of all the latest updates is by bookmarking OpenMetadata with a star! And, if you haven’t already, I'd like to invite you to join our upcoming virtual community meetup next Wednesday. We’ll be sharing the OMD Q1 roadmap along with a community spotlight featuring real-world use cases from Wix. Hope to see you there!
Hi, I am looking into it and raise the PR if possible.
Hi all, I checked this issue and also reviewed Rajdeep’s approach. His direction is close, but it still has a couple of gaps: in SQL 100% percentage mode it can still return deterministic rows because there is no guaranteed random ordering before LIMIT, and not randomizedSample also treats None like False, which can change default behavior.
In my fix, I handled randomization in the sample-data extraction path itself (where AutoClassifier reads rows), enforced random ordering before limit when needed, and handled randomizedSample safely (None is treated as default-enabled, not disabled). I also added coverage for 100% + True/False/None to avoid regressions.
Hi @TeddyCr Sir, my PR #26966 fixes this issue. Could you please assign this issue to me? Thanks!
HI @TeddyCr sir I would like to work on this issue. Please assign it to me. Thanks
@jatinmasaram this is already being taken cared of by @RajdeepKushwaha5
Hi @KarimTZiad! I'd like to work on this — could you assign it to me? Thanks!
This is already being worked on