Add write() to Query to support reducing a case dataset file.