You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by paul-rogers <gi...@git.apache.org> on 2017/05/25 21:41:23 UTC

[GitHub] drill pull request #789: DRILL-5356: Refactor Parquet Record Reader

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/789#discussion_r118591443
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/ParquetInternalsTest.java ---
    @@ -0,0 +1,161 @@
    +/*
    + * 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.exec.store.parquet;
    +
    +import static org.junit.Assert.*;
    +
    +import java.util.HashMap;
    +import java.util.Map;
    +
    +import org.apache.drill.TestBuilder;
    +import org.apache.drill.common.expression.SchemaPath;
    +import org.apache.drill.common.types.TypeProtos;
    +import org.apache.drill.common.types.Types;
    +import org.apache.drill.test.ClusterFixture;
    +import org.apache.drill.test.ClusterTest;
    +import org.apache.drill.test.FixtureBuilder;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +public class ParquetInternalsTest extends ClusterTest {
    +
    +  @BeforeClass
    +  public static void setup( ) throws Exception {
    +    FixtureBuilder builder = ClusterFixture.builder()
    +      // Set options, etc.
    +      ;
    +    startCluster(builder);
    +  }
    +
    +  @Test
    +  public void testFixedWidth() throws Exception {
    +    String sql = "SELECT l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity\n" +
    +                 "FROM `cp`.`tpch/lineitem.parquet` LIMIT 20";
    +//    client.queryBuilder().sql(sql).printCsv();
    +
    +    Map<SchemaPath, TypeProtos.MajorType> typeMap = new HashMap<>();
    +    typeMap.put(TestBuilder.parsePath("l_orderkey"), Types.required(TypeProtos.MinorType.INT));
    +    typeMap.put(TestBuilder.parsePath("l_partkey"), Types.required(TypeProtos.MinorType.INT));
    +    typeMap.put(TestBuilder.parsePath("l_suppkey"), Types.required(TypeProtos.MinorType.INT));
    +    typeMap.put(TestBuilder.parsePath("l_linenumber"), Types.required(TypeProtos.MinorType.INT));
    +    typeMap.put(TestBuilder.parsePath("l_quantity"), Types.required(TypeProtos.MinorType.FLOAT8));
    +    client.testBuilder()
    +      .sqlQuery(sql)
    +      .unOrdered()
    +      .csvBaselineFile("parquet/expected/fixedWidth.csv")
    +      .baselineColumns("l_orderkey", "l_partkey", "l_suppkey", "l_linenumber", "l_quantity")
    +      .baselineTypes(typeMap)
    +      .build()
    +      .run();
    +  }
    +
    +
    --- End diff --
    
    Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---