1$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
2$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
3$connection = $resource->getConnection('\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION');
4$results = $connection->fetchone($query);