Support writing input data to HDFS.

This saves a lot of time if tests are run repeatedly and generate
a lot of data.