OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Randomization of AutoClassifier Sample Data

Open KarimTZiad opened this issue 1 year ago • 14 comments

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.

KarimTZiad avatar May 20 '25 08:05 KarimTZiad

Hi! Are there any contributors working on this, otherwise I would like to take this up!

leafoffaith avatar Aug 22 '25 05:08 leafoffaith

@leafoffaith we can definitely assign it to you.

TeddyCr avatar Sep 02 '25 16:09 TeddyCr

hey @leafoffaith are you still interested in working on this?

TeddyCr avatar Sep 16 '25 07:09 TeddyCr

hey! sorry, I missed the notification. I would like to work on this, yes

leafoffaith avatar Sep 16 '25 07:09 leafoffaith

Hi! Is Leafooffaith still handling this? If not, I’d like to take it up.

lucifervb2248 avatar Oct 18 '25 12:10 lucifervb2248

@lucifervb2248 we have not had any PR yet, are you interested?

TeddyCr avatar Nov 27 '25 15:11 TeddyCr

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!

smga3000 avatar Jan 23 '26 17:01 smga3000

Hi, I am looking into it and raise the PR if possible.

abhayguptas avatar Apr 02 '26 09:04 abhayguptas

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.

abhayguptas avatar Apr 02 '26 10:04 abhayguptas

Hi @TeddyCr Sir, my PR #26966 fixes this issue. Could you please assign this issue to me? Thanks!

RajdeepKushwaha5 avatar Apr 03 '26 20:04 RajdeepKushwaha5

HI @TeddyCr sir I would like to work on this issue. Please assign it to me. Thanks

jatinmasaram avatar Apr 04 '26 08:04 jatinmasaram

@jatinmasaram this is already being taken cared of by @RajdeepKushwaha5

TeddyCr avatar Apr 07 '26 18:04 TeddyCr

Hi @KarimTZiad! I'd like to work on this — could you assign it to me? Thanks!

david-mamani avatar Apr 09 '26 02:04 david-mamani

This is already being worked on

TeddyCr avatar Apr 09 '26 23:04 TeddyCr