Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Export row count

Example. I want to know the total number of rows in a physical table after my transformations is done. Iam using a table update component where I export the row count as a variable and post that in a slack message. But the row count only returns the row count of the view that matillion uses to update the table, not the row count of the final table.

Any suggestion of how to better achieve my goal?

4 Community Answers

Johan Forssell —

(You should really include an edit option in the community)
In my final table i have approx 3 000 000 rows but if i use that table in a table input component the sample tab says its only 400 000 rows


Matillion Agent  

Laura Malins —

Hi Johan

You could do a simple select count(*) from tablename in a python script and post this to a variable. This would give you the true rowcount of the table.

The below is the python required:

cursor = context.cursor()
cursor.execute(‘select count(*) from mytable’)
rowcount = cursor.fetchone()0

The row count inconsistency sounds odd. If you restart the server via the Admin Console can you replicate the issue? If so, can we set up a screenshare so I can see it please?

Thanks
Laura


Johan Forssell —

Hi Laura. Thanks for your answer. I found the root of the inconsistency. I think the table input component was based on a old view created in redshift. When I deleted all my views and used the table input component again after revalidation I got the correct row count.


Matillion Agent  

Laura Malins —

Hi Johan

Thanks for confirming.

Thanks
Laura

Post Your Community Answer

To add an answer please login