drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #984: DRILL-5783 Made a unit test for generated Priority ...
Date Wed, 18 Oct 2017 22:24:07 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/984#discussion_r145516665
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/BatchUtils.java ---
    @@ -0,0 +1,280 @@
    +/*
    + * 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.collect.Lists;
    +import com.google.common.collect.Maps;
    +import org.apache.drill.exec.record.VectorContainer;
    +import org.apache.drill.exec.record.VectorWrapper;
    +import org.apache.drill.exec.record.selection.SelectionVector4;
    +import org.apache.drill.exec.vector.ValueVector;
    +import org.junit.Assert;
    +
    +import java.io.UnsupportedEncodingException;
    +import java.util.Arrays;
    +import java.util.Collections;
    +import java.util.Comparator;
    +import java.util.List;
    +import java.util.Map;
    +
    +public class BatchUtils {
    +  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BatchUtils.class);
    +
    +  public static Map<String, List<Object>> containerToObjects(VectorContainer
vectorContainer) {
    --- End diff --
    
    Do we really want to create yet another way to muck with data? Any reason we can't use
the `RowSet` concepts here? I fear that if we have multiple ways to do the same thing, we
won't achieve critical mass on any of them and we'll have a bunch of half-baked solutions.
I'd rather have one fully-baked solution we use over and over. Allows new tests to get done
easily because the required tools already exist. This, in turn, encourages testing.
    
    What are we doing here that `RowSet` can't (yet) do?


---

Mime
View raw message