You’ll have to have some way of specifying that arr1 doesn’t contain a column_name – either by inserting nil or using a Hash instead ({dbname: 'devdb', tablename: 'emp_table', action: 'added'}).
Once you’ve got that, @imperiumzigna’s suggestion will work – or you could use to_csv instead of join. (As a matter of fact, it seems you don’t need flatten with join, but you will with to_csv.)
Personally I like to work with CSV::Table rather than just CSV, but it is a bit more complex and doesn’t natively support easy conversions from other data types.