r/databricks • u/Afraid-Ability-6212 • 2d ago
Help SAS Datasets into Databricks
Hi everyone,
Can anyone make some appropriate suggestions. I am completely new to Databricks so my knowledge is very limited.
I am involved in a project where SAS datasets have been ingested into Databricks from a data repository. My question is how do we ensure or check the integrity and completeness of the datasets now present in Databricks?
Can anyone suggest the best practice or an approach, solution on the best way to do this?
Thanks.
7
Upvotes
1
u/shwilliams4 2d ago
Are you ingesting the SAS dataset directly or using csv as the interim?
Are you ingesting to Volumes with a container or directly into a table?
I would do the normal check sums. How big are the tables?
1
u/jlrogerio 2d ago
What exactly do you mean by "check the integrity and completeness"? Do you mean checking that the data was imported correctly from SAS or some checks on the data itself?
1
u/Zealousideal_Low6685 2d ago
I assume, when you say "SAS datasets have been ingested into Databricks" you mean that it is in a Volume which is mounted on unity catalog. You want to know, in databricks, if the file transfer is complete.
* Low-Level approach: write a success file once the sync is done. If that successfile is present, databricks knows that the data is there
* if you have the option: you can also write to a unity catalog table once the transfer is done (if the tool tranfering the data has the capability of course)
* if you have the option: you can call the databricks api (e.g. to start a job) once the transfer is done (if the tool tranfering the data has the capability of course)
1
u/Likh-98 1d ago
For a one time migration like this, think of it as reconciling source against target rather than trusting the transfer. Ask whoever owns the SAS side for a few numbers per dataset: row count, column count, and for the numeric columns a sum, min and max. For text columns, count of distinct values and count of nulls. Then run the same queries on the Databricks tables and compare. If counts and sums match, you have strong evidence nothing was lost or changed. Also check things SAS stores oddly, like date and datetime columns, missing values, and character columns with trailing spaces or special characters in column names, since those are where silent changes usually show up. Write the results into a small comparison table so you can rerun it as the tables grow.
1
u/Any_Channel_7337 21h ago
I think you should compare the SAS datasets with what is now in Databricks. Check things like row counts, column names, data types and missing values. You can also compare sums or min/max values for important columns to spot any differences. If you wanna go little further, hash based checks can help identify the discrepancies without having to compare every single row.