  We study the geometric properties of holomorphic distributions of totally
null $m$-planes on a $(2m+\epsilon)$-dimensional complex Riemannian manifold
$(\mathcal{M}, \bm{g})$, where $\epsilon \in {0,1}$ and $m \geq 2$. In
particular, given such a distribution $\mathcal{N}$, say, we obtain algebraic
conditions on the Weyl tensor and the Cotton-York tensor which guarrantee the
integrability of $\mathcal{N}$, and in odd dimensions, of its orthogonal
complement. These results generalise the Petrov classification of the
(anti-)self-dual part of the complex Weyl tensor, and the complex
Goldberg-Sachs theorem from four to higher dimensions.
  Higher-dimensional analogues of the Petrov type D condition are defined, and
we show that these lead to the integrability of up to $2^m$ holomorphic
distributions of totally null $m$-planes. Finally, we adapt these findings to
the category of real smooth pseudo-Riemannian manifolds, commenting notably on
the applications to Hermitian geometry and Robinson (or optical) geometry.
