Writing a dataset to LibSVM format raises an exception
java.util.NoSuchElementException: key not found: numFeatures
Happens only when the dataset was NOT read from a LibSVM format before (because otherwise numFeatures is in its metadata). Steps to reproduce:
PR with a fix and unit test is ready - see https://github.com/apache/spark/pull/18872.