{"action":"created","issue":{"url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/40","labels_url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/40/comments","events_url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/40/events","html_url":"https://github.com/killbill/killbill-analytics-plugin/issues/40","id":86772071,"number":40,"title":"Some analytics tables have some duplicate rows","user":{"login":"kevinpostlewaite","id":1063461,"avatar_url":"https://avatars.githubusercontent.com/u/1063461?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinpostlewaite","html_url":"https://github.com/kevinpostlewaite","followers_url":"https://api.github.com/users/kevinpostlewaite/followers","following_url":"https://api.github.com/users/kevinpostlewaite/following{/other_user}","gists_url":"https://api.github.com/users/kevinpostlewaite/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinpostlewaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinpostlewaite/subscriptions","organizations_url":"https://api.github.com/users/kevinpostlewaite/orgs","repos_url":"https://api.github.com/users/kevinpostlewaite/repos","events_url":"https://api.github.com/users/kevinpostlewaite/events{/privacy}","received_events_url":"https://api.github.com/users/kevinpostlewaite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-09T23:45:52Z","updated_at":"2015-06-30T04:20:13Z","closed_at":null,"body":"Some analytics have multiple rows for the same source row when there should be only one row in the analytics table. Refreshing the associated account in analytics corrects this problem for the affected accounts.\r\n\r\nTablename\t\t\t\t\t\tRepeated row count\r\nanalytics_payment_auths\t\t\t10\r\nanalytics_payment_captures\t\t\t3\r\nanalytics_payment_refunds\t\t\t3\r\nanalytics_accounts\t\t\t\t\t0\r\nanalytics_bundles\t\t\t\t\t0\r\nanalytics_invoice_adjustments\t\t0\r\nanalytics_invoice_credits\t\t\t\t0\r\nanalytics_invoice_item_adjustments\t0\r\nanalytics_invoice_items\t\t\t\t0\r\nanalytics_invoices\t\t\t\t\t0\r\nanalytics_payment_credits\t\t\t0\r\nanalytics_payment_chargebacks\t\t0\r\nanalytics_payment_purchases\t\t0\r\nanalytics_payment_voids\t\t\t0\r\n\r\nselect 'analytics_accounts' as table_name, ifnull(count(1),0) from (\r\n    select account_record_id from analytics_accounts a group by 1 having count(1)>1 ) b\r\nUNION    \r\nselect 'analytics_bundles' as table_name, count(1) from (\r\n    select bundle_record_id from analytics_bundles a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_invoice_adjustments' as table_name, ifnull(count(1),0) from (\r\n    select invoice_item_record_id from analytics_invoice_adjustments a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_invoice_credits' as table_name, ifnull(count(1),0) from (\r\n    select invoice_item_record_id from analytics_invoice_credits a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_invoice_item_adjustments' as table_name, ifnull(count(1),0) from (\r\n    select invoice_item_record_id from analytics_invoice_item_adjustments a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_invoice_items' as table_name, ifnull(count(1),0) from (\r\n    select invoice_item_record_id from analytics_invoice_items a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_invoices' as table_name, ifnull(count(1),0) from (\r\n    select invoice_record_id from analytics_invoices a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_auths' as table_name, ifnull(count(1),0) from (\r\n    select payment_transaction_id from analytics_payment_auths a group by 1 having count(1)>1 ) b\r\nUNION    \r\nselect 'analytics_payment_captures' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_captures a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_credits' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_credits a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_chargebacks' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_chargebacks a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_purchases' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_purchases a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_refunds' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_refunds a group by 1 having count(1)>1 ) b\r\nUNION\r\nselect 'analytics_payment_voids' as table_name, count(1) from (\r\n    select payment_transaction_id from analytics_payment_voids a group by 1 having count(1)>1 ) b"},"comment":{"url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/comments/116949671","html_url":"https://github.com/killbill/killbill-analytics-plugin/issues/40#issuecomment-116949671","issue_url":"https://api.github.com/repos/killbill/killbill-analytics-plugin/issues/40","id":116949671,"user":{"login":"pierre","id":51940,"avatar_url":"https://avatars.githubusercontent.com/u/51940?v=3","gravatar_id":"","url":"https://api.github.com/users/pierre","html_url":"https://github.com/pierre","followers_url":"https://api.github.com/users/pierre/followers","following_url":"https://api.github.com/users/pierre/following{/other_user}","gists_url":"https://api.github.com/users/pierre/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre/subscriptions","organizations_url":"https://api.github.com/users/pierre/orgs","repos_url":"https://api.github.com/users/pierre/repos","events_url":"https://api.github.com/users/pierre/events{/privacy}","received_events_url":"https://api.github.com/users/pierre/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T04:20:13Z","updated_at":"2015-06-30T04:20:13Z","body":"As far as we can, yes: https://github.com/killbill/killbill-analytics-plugin/blob/master/src/main/java/org/killbill/billing/plugin/analytics/AnalyticsListener.java#L203"}}