Good company is very important otherwise in this world all will be affected but in Qiyamah will be separate

» : 2وَعَنْ أُمِّ الْمُؤْمِنِينَ أُمِّ عَبْدِ اللَّهِ عَائشَةَ رَضيَ الله عنها قالت: قال رسول الله صَلّى اللهُ عَلَيْهِ وسَلَّم
قَالَتْ : قُلْتُ يَا رَسُولَ اللَّهِ ، آَيْفَ .«يَغْزُو جَيْشٌ الْكَعْبَةَ فَإِذَا آَانُوا ببيْداءَ مِنَ الأَرْضِ يُخْسَفُ بأَوَّلِهِم وَآخِرِهِمْ
يُخْسَفُ بِأَوَّلِهِم وَآخِرِهِمْ ، ثُمَّ يُبْعَثُون عَلَى » : يُخْسَفُ بَأَوَّلِهِم وَآخِرِهِمْ وَفِيهِمْ أَسْوَاقُهُمْ وَمَنْ لَيْسَ مِنهُمْ ،؟ قَالَ
مُتَّفَقٌ عَلَيْهِ : هذا لَفْظُ الْبُخَارِيِّ . « نِيَّاتِهِمْ
2. Narrated 'A`ishah (May Allah be pleased with her) reported: Messenger of Allah (PBUH) said, 
"An army will raid the Ka`bah and when it reaches a desert land, all of them will be swallowed up by the earth.''
 She asked; "O Messenger of Allah! Why all of them?'' 

He answered, "All of them will be swallowed by the earth but they will be raised for Judgement according to their intentions.''
[Al-Bukhari and Muslim].

Commentary: Everyone will be rewarded or punished according to his aim and intention. This Hadith also proves
that the company of depraved persons is extremely dangerous. 

We should be careful about our company otherwise If Azab of Allah comes even good people will be affected .

Whose army would it be, which has been referred to
in the Hadith, and when will it invade Ka`bah, is a matter known to Allah Alone. Such prophecies are a part of the
Unseen world. Since they come in the category of the miracles of the Prophet (PBUH), it is necessary to believe in
their veracity and occurrence. Believing in such prophesies is also essential because they were revealed by Allah).