I am trying to join customer entity table and customer address entity table. I am getting error in below code. What could be the issue
$agency_name=$customerData->getDefaultShippingAddress()->getAgencyName();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$customerTable = $resource->getTableName('customer_entity');
$customerObj = $objectManager->create('Magento\Customer\Model\ResourceModel\Address\Collection');
$collection = $customerObj
->addAttributeToSelect('agency_name', 'customer_address_entity')
->addAttributeToFilter('agency_name',array('eq'=>$agency_name));
//->load();
$collection->getSelect()->join(['ct'=>$customerTable],'main_table.parent_id=ct.entity_id',[]);
$c_data=$collection->getData();
print_r($c_data);
Giving me error.Please Help