Need this for extra select columns

I have this funky QueryBuilder: 

->select('d, CAST(d.document_number AS SIGNED) AS HIDDEN number')
->innerJoin('d.node', 'n')
->where('n.parent = :parent')
->setParameter('parent', $client->getBox(FolderNode::BOX_SENTBOX))
->andWhere('d.processed = :processed')
->setParameter('processed', false)
->andWhere('d.journal_code is not null')
->addOrderBy('d.journal_code', 'ASC')
->addOrderBy('number', 'ASC')

adding the order by on number throws an error on "$expr->identificationVariable" since it's not an object.