Hi @Gużewski, Jacek ,
As per my understanding you are trying to know if csv file contains any data or not, or if it contains more than 5k rows, so basically you want to know the count of the records present in the csv file.
If it would have been a SQL table, it would be an easier task just to use a select count(*) from table query . But in your case, since it's csv file, there could be two options you can try:
- You can use 'copy activity' to move the data from csv file to SQL table which would lead to provide the rowcount as the copy activity output which can be further used in the pipeline to check if the count is greater than 5k rows then do this or else do that :
@activity('Copy data1').output.rowsRead
- Second approach would be to use dataflow to get the count of rows [Source (csvfile) -> DerivedColumn (rowcount) -> Aggregate (count(rowcount)) -> sink (cache the output of aggregate)]
Watchout this video for reference : https://www.youtube.com/watch?v=ZUOowfJrrf4
In case there is not id/Sno column, then we can use surrogate key to create id column first
Hope it helps. Kindly accept the answer by clicking on Accept answer
button. Thankyou