Github user ilooner commented on a diff in the pull request: https://github.com/apache/drill/pull/984#discussion_r148396417 --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/TableFileBuilder.java --- @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.drill.test; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.List; + +public class TableFileBuilder +{ + private final List<String> columnNames; + private final List<String> columnFormatters; + private final List<Object[]> rows = Lists.newArrayList(); + private final String rowString; + + public TableFileBuilder(List<String> columnNames, List<String> columnFormatters) { --- End diff -- I've switched this around a bit. The general flow is now the following: 1. A **RowSet** is constructed with a **RowSetBuilder** 1. A **JsonFileBuilder** is created and configured to use the **RowSet** that was just created. 1. The **JsonFileBuilder** reads the **RowSet** and writes it out to a file in a json format.
---