parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [23/51] [partial] parquet-mr git commit: PARQUET-23: Rename to org.apache.parquet.
Date Mon, 27 Apr 2015 23:12:20 GMT
http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/mem/TestMemColumn.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/mem/TestMemColumn.java b/parquet-column/src/test/java/parquet/column/mem/TestMemColumn.java
deleted file mode 100644
index 28440a6..0000000
--- a/parquet-column/src/test/java/parquet/column/mem/TestMemColumn.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* 
- * 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 parquet.column.mem;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import parquet.Log;
-import parquet.column.ColumnDescriptor;
-import parquet.column.ColumnReader;
-import parquet.column.ColumnWriter;
-import parquet.column.ParquetProperties.WriterVersion;
-import parquet.column.impl.ColumnReadStoreImpl;
-import parquet.column.impl.ColumnWriteStoreV1;
-import parquet.column.page.mem.MemPageStore;
-import parquet.example.DummyRecordConverter;
-import parquet.io.api.Binary;
-import parquet.schema.MessageType;
-import parquet.schema.MessageTypeParser;
-
-public class TestMemColumn {
-  private static final Log LOG = Log.getLog(TestMemColumn.class);
-
-  @Test
-  public void testMemColumn() throws Exception {
-    MessageType schema = MessageTypeParser.parseMessageType("message msg { required group foo { required int64 bar; } }");
-    ColumnDescriptor path = schema.getColumnDescription(new String[] {"foo", "bar"});
-    MemPageStore memPageStore = new MemPageStore(10);
-    ColumnWriteStoreV1 memColumnsStore = newColumnWriteStoreImpl(memPageStore);
-    ColumnWriter columnWriter = memColumnsStore.getColumnWriter(path);
-    columnWriter.write(42l, 0, 0);
-    memColumnsStore.flush();
-
-    ColumnReader columnReader = getColumnReader(memPageStore, path, schema);
-    for (int i = 0; i < columnReader.getTotalValueCount(); i++) {
-      assertEquals(columnReader.getCurrentRepetitionLevel(), 0);
-      assertEquals(columnReader.getCurrentDefinitionLevel(), 0);
-      assertEquals(columnReader.getLong(), 42);
-      columnReader.consume();
-    }
-  }
-
-  private ColumnWriter getColumnWriter(ColumnDescriptor path, MemPageStore memPageStore) {
-    ColumnWriteStoreV1 memColumnsStore = newColumnWriteStoreImpl(memPageStore);
-    ColumnWriter columnWriter = memColumnsStore.getColumnWriter(path);
-    return columnWriter;
-  }
-
-  private ColumnReader getColumnReader(MemPageStore memPageStore, ColumnDescriptor path, MessageType schema) {
-    return new ColumnReadStoreImpl(
-        memPageStore,
-        new DummyRecordConverter(schema).getRootConverter(),
-        schema
-        ).getColumnReader(path);
-  }
-
-  @Test
-  public void testMemColumnBinary() throws Exception {
-    MessageType mt = MessageTypeParser.parseMessageType("message msg { required group foo { required binary bar; } }");
-    String[] col = new String[]{"foo", "bar"};
-    MemPageStore memPageStore = new MemPageStore(10);
-
-    ColumnWriteStoreV1 memColumnsStore = newColumnWriteStoreImpl(memPageStore);
-    ColumnDescriptor path1 = mt.getColumnDescription(col);
-    ColumnDescriptor path = path1;
-
-    ColumnWriter columnWriter = memColumnsStore.getColumnWriter(path);
-    columnWriter.write(Binary.fromString("42"), 0, 0);
-    memColumnsStore.flush();
-
-    ColumnReader columnReader = getColumnReader(memPageStore, path, mt);
-    for (int i = 0; i < columnReader.getTotalValueCount(); i++) {
-      assertEquals(columnReader.getCurrentRepetitionLevel(), 0);
-      assertEquals(columnReader.getCurrentDefinitionLevel(), 0);
-      assertEquals(columnReader.getBinary().toStringUsingUTF8(), "42");
-      columnReader.consume();
-    }
-  }
-
-  @Test
-  public void testMemColumnSeveralPages() throws Exception {
-    MessageType mt = MessageTypeParser.parseMessageType("message msg { required group foo { required int64 bar; } }");
-    String[] col = new String[]{"foo", "bar"};
-    MemPageStore memPageStore = new MemPageStore(10);
-    ColumnWriteStoreV1 memColumnsStore = newColumnWriteStoreImpl(memPageStore);
-    ColumnDescriptor path1 = mt.getColumnDescription(col);
-    ColumnDescriptor path = path1;
-
-    ColumnWriter columnWriter = memColumnsStore.getColumnWriter(path);
-    for (int i = 0; i < 2000; i++) {
-      columnWriter.write(42l, 0, 0);
-    }
-    memColumnsStore.flush();
-
-    ColumnReader columnReader = getColumnReader(memPageStore, path, mt);
-    for (int i = 0; i < columnReader.getTotalValueCount(); i++) {
-      assertEquals(columnReader.getCurrentRepetitionLevel(), 0);
-      assertEquals(columnReader.getCurrentDefinitionLevel(), 0);
-      assertEquals(columnReader.getLong(), 42);
-      columnReader.consume();
-    }
-  }
-
-  @Test
-  public void testMemColumnSeveralPagesRepeated() throws Exception {
-    MessageType mt = MessageTypeParser.parseMessageType("message msg { repeated group foo { repeated int64 bar; } }");
-    String[] col = new String[]{"foo", "bar"};
-    MemPageStore memPageStore = new MemPageStore(10);
-    ColumnWriteStoreV1 memColumnsStore = newColumnWriteStoreImpl(memPageStore);
-    ColumnDescriptor path1 = mt.getColumnDescription(col);
-    ColumnDescriptor path = path1;
-
-    ColumnWriter columnWriter = memColumnsStore.getColumnWriter(path);
-    int[] rs = { 0, 0, 0, 1, 1, 1, 2, 2, 2};
-    int[] ds = { 0, 1, 2, 0, 1, 2, 0, 1, 2};
-    for (int i = 0; i < 837; i++) {
-      int r = rs[i % rs.length];
-      int d = ds[i % ds.length];
-      LOG.debug("write i: " + i);
-      if (d == 2) {
-        columnWriter.write((long)i, r, d);
-      } else {
-        columnWriter.writeNull(r, d);
-      }
-    }
-    memColumnsStore.flush();
-
-    ColumnReader columnReader = getColumnReader(memPageStore, path, mt);
-    int i = 0;
-    for (int j = 0; j < columnReader.getTotalValueCount(); j++) {
-      int r = rs[i % rs.length];
-      int d = ds[i % ds.length];
-      LOG.debug("read i: " + i);
-      assertEquals("r row " + i, r, columnReader.getCurrentRepetitionLevel());
-      assertEquals("d row " + i, d, columnReader.getCurrentDefinitionLevel());
-      if (d == 2) {
-        assertEquals("data row " + i, (long)i, columnReader.getLong());
-      }
-      columnReader.consume();
-      ++ i;
-    }
-  }
-
-  private ColumnWriteStoreV1 newColumnWriteStoreImpl(MemPageStore memPageStore) {
-    return new ColumnWriteStoreV1(memPageStore, 2048, 2048, false, WriterVersion.PARQUET_1_0);
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/mem/TestMemPageStore.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/mem/TestMemPageStore.java b/parquet-column/src/test/java/parquet/column/mem/TestMemPageStore.java
deleted file mode 100644
index e320227..0000000
--- a/parquet-column/src/test/java/parquet/column/mem/TestMemPageStore.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* 
- * 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 parquet.column.mem;
-
-import static parquet.column.Encoding.*;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-import parquet.bytes.BytesInput;
-import parquet.column.ColumnDescriptor;
-import parquet.column.page.DataPage;
-import parquet.column.page.PageReader;
-import parquet.column.page.PageWriter;
-import parquet.column.page.mem.MemPageStore;
-import parquet.column.statistics.LongStatistics;
-import parquet.schema.PrimitiveType.PrimitiveTypeName;
-
-public class TestMemPageStore {
-
-  private String[] path = { "foo", "bar"};
-
-  @Test
-  public void test() throws IOException {
-    MemPageStore memPageStore = new MemPageStore(10);
-    ColumnDescriptor col = new ColumnDescriptor(path , PrimitiveTypeName.INT64, 2, 2);
-    LongStatistics stats = new LongStatistics();
-    PageWriter pageWriter = memPageStore.getPageWriter(col);
-    pageWriter.writePage(BytesInput.from(new byte[735]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
-    pageWriter.writePage(BytesInput.from(new byte[743]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
-    pageWriter.writePage(BytesInput.from(new byte[743]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
-    pageWriter.writePage(BytesInput.from(new byte[735]), 209, stats, BIT_PACKED, BIT_PACKED, PLAIN);
-    PageReader pageReader = memPageStore.getPageReader(col);
-    long totalValueCount = pageReader.getTotalValueCount();
-    System.out.println(totalValueCount);
-    int total = 0;
-    do {
-      DataPage readPage = pageReader.readPage();
-      total += readPage.getValueCount();
-      System.out.println(readPage);
-      // TODO: assert
-    } while (total < totalValueCount);
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/page/mem/MemPageReader.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/page/mem/MemPageReader.java b/parquet-column/src/test/java/parquet/column/page/mem/MemPageReader.java
deleted file mode 100644
index 0112410..0000000
--- a/parquet-column/src/test/java/parquet/column/page/mem/MemPageReader.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* 
- * 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 parquet.column.page.mem;
-
-import static parquet.Log.DEBUG;
-import static parquet.Preconditions.checkNotNull;
-
-import java.util.Iterator;
-
-import parquet.Log;
-import parquet.column.page.DictionaryPage;
-import parquet.column.page.DataPage;
-import parquet.column.page.PageReader;
-import parquet.io.ParquetDecodingException;
-
-
-public class MemPageReader implements PageReader {
-  private static final Log LOG = Log.getLog(MemPageReader.class);
-
-  private final long totalValueCount;
-  private final Iterator<DataPage> pages;
-  private final DictionaryPage dictionaryPage;
-
-  public MemPageReader(long totalValueCount, Iterator<DataPage> pages, DictionaryPage dictionaryPage) {
-    super();
-    checkNotNull(pages, "pages");
-    this.totalValueCount = totalValueCount;
-    this.pages = pages;
-    this.dictionaryPage = dictionaryPage;
-  }
-
-  @Override
-  public long getTotalValueCount() {
-    return totalValueCount;
-  }
-
-  @Override
-  public DataPage readPage() {
-    if (pages.hasNext()) {
-      DataPage next = pages.next();
-      if (DEBUG) LOG.debug("read page " + next);
-      return next;
-    } else {
-      throw new ParquetDecodingException("after last page");
-    }
-  }
-
-  @Override
-  public DictionaryPage readDictionaryPage() {
-    return dictionaryPage;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/page/mem/MemPageStore.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/page/mem/MemPageStore.java b/parquet-column/src/test/java/parquet/column/page/mem/MemPageStore.java
deleted file mode 100644
index 1112843..0000000
--- a/parquet-column/src/test/java/parquet/column/page/mem/MemPageStore.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* 
- * 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 parquet.column.page.mem;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import parquet.Log;
-import parquet.column.ColumnDescriptor;
-import parquet.column.UnknownColumnException;
-import parquet.column.page.DataPage;
-import parquet.column.page.PageReadStore;
-import parquet.column.page.PageReader;
-import parquet.column.page.PageWriteStore;
-import parquet.column.page.PageWriter;
-
-
-public class MemPageStore implements PageReadStore, PageWriteStore {
-  private static final Log LOG = Log.getLog(MemPageStore.class);
-
-  private Map<ColumnDescriptor, MemPageWriter> pageWriters = new HashMap<ColumnDescriptor, MemPageWriter>();
-
-  private long rowCount;
-
-  public MemPageStore(long rowCount) {
-    super();
-    this.rowCount = rowCount;
-  }
-
-  @Override
-  public PageWriter getPageWriter(ColumnDescriptor path) {
-    MemPageWriter pageWriter = pageWriters.get(path);
-    if (pageWriter == null) {
-      pageWriter = new MemPageWriter();
-      pageWriters.put(path, pageWriter);
-    }
-    return pageWriter;
-  }
-
-  @Override
-  public PageReader getPageReader(ColumnDescriptor descriptor) {
-    MemPageWriter pageWriter = pageWriters.get(descriptor);
-    if (pageWriter == null) {
-      throw new UnknownColumnException(descriptor);
-    }
-    List<DataPage> pages = new ArrayList<DataPage>(pageWriter.getPages());
-    if (Log.DEBUG) LOG.debug("initialize page reader with "+ pageWriter.getTotalValueCount() + " values and " + pages.size() + " pages");
-    return new MemPageReader(pageWriter.getTotalValueCount(), pages.iterator(), pageWriter.getDictionaryPage());
-  }
-
-  @Override
-  public long getRowCount() {
-    return rowCount;
-  }
-
-  public void addRowCount(long count) {
-    rowCount += count;
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/page/mem/MemPageWriter.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/page/mem/MemPageWriter.java b/parquet-column/src/test/java/parquet/column/page/mem/MemPageWriter.java
deleted file mode 100644
index 5157b4f..0000000
--- a/parquet-column/src/test/java/parquet/column/page/mem/MemPageWriter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* 
- * 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 parquet.column.page.mem;
-
-import static parquet.Log.DEBUG;
-import static parquet.bytes.BytesInput.copy;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import parquet.Log;
-import parquet.bytes.BytesInput;
-import parquet.column.Encoding;
-import parquet.column.page.DataPageV1;
-import parquet.column.page.DataPageV2;
-import parquet.column.page.DictionaryPage;
-import parquet.column.page.DataPage;
-import parquet.column.page.PageWriter;
-import parquet.column.statistics.Statistics;
-import parquet.io.ParquetEncodingException;
-
-public class MemPageWriter implements PageWriter {
-  private static final Log LOG = Log.getLog(MemPageWriter.class);
-
-  private final List<DataPage> pages = new ArrayList<DataPage>();
-  private DictionaryPage dictionaryPage;
-  private long memSize = 0;
-  private long totalValueCount = 0;
-
-  @Override
-  public void writePage(BytesInput bytesInput, int valueCount, Statistics statistics, Encoding rlEncoding, Encoding dlEncoding, Encoding valuesEncoding)
-      throws IOException {
-    if (valueCount == 0) {
-      throw new ParquetEncodingException("illegal page of 0 values");
-    }
-    memSize += bytesInput.size();
-    pages.add(new DataPageV1(BytesInput.copy(bytesInput), valueCount, (int)bytesInput.size(), statistics, rlEncoding, dlEncoding, valuesEncoding));
-    totalValueCount += valueCount;
-    if (DEBUG) LOG.debug("page written for " + bytesInput.size() + " bytes and " + valueCount + " records");
-  }
-
-  @Override
-  public void writePageV2(int rowCount, int nullCount, int valueCount,
-      BytesInput repetitionLevels, BytesInput definitionLevels,
-      Encoding dataEncoding, BytesInput data, Statistics<?> statistics) throws IOException {
-    if (valueCount == 0) {
-      throw new ParquetEncodingException("illegal page of 0 values");
-    }
-    long size = repetitionLevels.size() + definitionLevels.size() + data.size();
-    memSize += size;
-    pages.add(DataPageV2.uncompressed(rowCount, nullCount, valueCount, copy(repetitionLevels), copy(definitionLevels), dataEncoding, copy(data), statistics));
-    totalValueCount += valueCount;
-    if (DEBUG) LOG.debug("page written for " + size + " bytes and " + valueCount + " records");
-
-  }
-
-  @Override
-  public long getMemSize() {
-    return memSize;
-  }
-
-  public List<DataPage> getPages() {
-    return pages;
-  }
-
-  public DictionaryPage getDictionaryPage() {
-    return dictionaryPage;
-  }
-
-  public long getTotalValueCount() {
-    return totalValueCount;
-  }
-
-  @Override
-  public long allocatedSize() {
-    // this store keeps only the bytes written
-    return memSize;
-  }
-
-  @Override
-  public void writeDictionaryPage(DictionaryPage dictionaryPage) throws IOException {
-    if (this.dictionaryPage != null) {
-      throw new ParquetEncodingException("Only one dictionary page per block");
-    }
-    this.memSize += dictionaryPage.getBytes().size();
-    this.dictionaryPage = dictionaryPage.copy();
-    if (DEBUG) LOG.debug("dictionary page written for " + dictionaryPage.getBytes().size() + " bytes and " + dictionaryPage.getDictionarySize() + " records");
-  }
-
-  @Override
-  public String memUsageString(String prefix) {
-    return String.format("%s %,d bytes", prefix, memSize);
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/statistics/TestStatistics.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/statistics/TestStatistics.java b/parquet-column/src/test/java/parquet/column/statistics/TestStatistics.java
deleted file mode 100644
index 197c25c..0000000
--- a/parquet-column/src/test/java/parquet/column/statistics/TestStatistics.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/* 
- * 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 parquet.column.statistics;
-
-import static org.junit.Assert.*;
-
-import java.nio.ByteBuffer;
-
-import org.junit.Test;
-
-import parquet.io.api.Binary;
-
-public class TestStatistics {
-  private int[] integerArray;
-  private long[] longArray;
-  private float[] floatArray;
-  private double[] doubleArray;
-  private String[] stringArray;
-  private boolean[] booleanArray;
-
-  @Test
-  public void testNumNulls() {
-    IntStatistics stats = new IntStatistics();
-    assertEquals(stats.getNumNulls(), 0);
-
-    stats.incrementNumNulls();
-    stats.incrementNumNulls();
-    stats.incrementNumNulls();
-    stats.incrementNumNulls();
-    assertEquals(stats.getNumNulls(), 4);
-
-    stats.incrementNumNulls(5);
-    assertEquals(stats.getNumNulls(), 9);
-
-    stats.setNumNulls(22);
-    assertEquals(stats.getNumNulls(), 22);
-  }
-
-  @Test
-  public void testIntMinMax() {
-    // Test basic max/min
-    integerArray = new int[] {1, 3, 14, 54, 66, 8, 0, 23, 54};
-    IntStatistics stats = new IntStatistics();
-
-    for (int i: integerArray) {
-      stats.updateStats(i);
-    }
-    assertEquals(stats.getMax(), 66);
-    assertEquals(stats.getMin(), 0);
-
-    // Test negative values
-    integerArray = new int[] {-11, 3, -14, 54, -66, 8, 0, -23, 54};
-    IntStatistics statsNeg = new IntStatistics();
-
-    for (int i: integerArray) {
-      statsNeg.updateStats(i);
-    }
-    assertEquals(statsNeg.getMax(), 54);
-    assertEquals(statsNeg.getMin(), -66);
-
-    // Test converting to and from byte[]
-    byte[] intMaxBytes = statsNeg.getMaxBytes();
-    byte[] intMinBytes = statsNeg.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(intMaxBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt(), 54);
-    assertEquals(ByteBuffer.wrap(intMinBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt(), -66);
-
-    IntStatistics statsFromBytes = new IntStatistics();
-    statsFromBytes.setMinMaxFromBytes(intMinBytes, intMaxBytes);
-
-    assertEquals(statsFromBytes.getMax(), 54);
-    assertEquals(statsFromBytes.getMin(), -66);
-
-    integerArray = new int[] {Integer.MAX_VALUE, Integer.MIN_VALUE};
-    IntStatistics minMaxValues = new IntStatistics();
-
-    for (int i: integerArray) {
-      minMaxValues.updateStats(i);
-    }
-    assertEquals(minMaxValues.getMax(), Integer.MAX_VALUE);
-    assertEquals(minMaxValues.getMin(), Integer.MIN_VALUE);
-
-    // Test converting to and from byte[] for large and small values
-    byte[] intMaxBytesMinMax = minMaxValues.getMaxBytes();
-    byte[] intMinBytesMinMax = minMaxValues.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(intMaxBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt(), Integer.MAX_VALUE);
-    assertEquals(ByteBuffer.wrap(intMinBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt(), Integer.MIN_VALUE);
-
-    IntStatistics statsFromBytesMinMax= new IntStatistics();
-    statsFromBytesMinMax.setMinMaxFromBytes(intMinBytesMinMax, intMaxBytesMinMax);
-
-    assertEquals(statsFromBytesMinMax.getMax(), Integer.MAX_VALUE);
-    assertEquals(statsFromBytesMinMax.getMin(), Integer.MIN_VALUE);
-
-    // Test print formatting
-    assertEquals(stats.toString(), "min: 0, max: 66, num_nulls: 0");
-  }
-
-  @Test
-  public void testLongMinMax() {
-    // Test basic max/min
-    longArray = new long[] {9, 39, 99, 3, 0, 12, 1000, 65, 542};
-    LongStatistics stats = new LongStatistics();
-
-    for (long l: longArray) {
-      stats.updateStats(l);
-    }
-    assertEquals(stats.getMax(), 1000);
-    assertEquals(stats.getMin(), 0);
-
-    // Test negative values
-    longArray = new long[] {-101, 993, -9914, 54, -9, 89, 0, -23, 90};
-    LongStatistics statsNeg = new LongStatistics();
-
-    for (long l: longArray) {
-      statsNeg.updateStats(l);
-    }
-    assertEquals(statsNeg.getMax(), 993);
-    assertEquals(statsNeg.getMin(), -9914);
-
-    // Test converting to and from byte[]
-    byte[] longMaxBytes = statsNeg.getMaxBytes();
-    byte[] longMinBytes = statsNeg.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(longMaxBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong(), 993);
-    assertEquals(ByteBuffer.wrap(longMinBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong(), -9914);
-
-    LongStatistics statsFromBytes = new LongStatistics();
-    statsFromBytes.setMinMaxFromBytes(longMinBytes, longMaxBytes);
-
-    assertEquals(statsFromBytes.getMax(), 993);
-    assertEquals(statsFromBytes.getMin(), -9914);
-
-    longArray = new long[] {Long.MAX_VALUE, Long.MIN_VALUE};
-    LongStatistics minMaxValues = new LongStatistics();
-
-    for (long l: longArray) {
-      minMaxValues.updateStats(l);
-    }
-    assertEquals(minMaxValues.getMax(), Long.MAX_VALUE);
-    assertEquals(minMaxValues.getMin(), Long.MIN_VALUE);
-
-    // Test converting to and from byte[] for large and small values
-    byte[] longMaxBytesMinMax = minMaxValues.getMaxBytes();
-    byte[] longMinBytesMinMax = minMaxValues.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(longMaxBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong(), Long.MAX_VALUE);
-    assertEquals(ByteBuffer.wrap(longMinBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong(), Long.MIN_VALUE);
-
-    LongStatistics statsFromBytesMinMax= new LongStatistics();
-    statsFromBytesMinMax.setMinMaxFromBytes(longMinBytesMinMax, longMaxBytesMinMax);
-
-    assertEquals(statsFromBytesMinMax.getMax(), Long.MAX_VALUE);
-    assertEquals(statsFromBytesMinMax.getMin(), Long.MIN_VALUE);
-
-    // Test print formatting
-    assertEquals(stats.toString(), "min: 0, max: 1000, num_nulls: 0");
-  }
-
-  @Test
-  public void testFloatMinMax() {
-    // Test basic max/min
-    floatArray = new float[] {1.5f, 44.5f, 412.99f, 0.65f, 5.6f, 100.6f, 0.0001f, 23.0f, 553.6f};
-    FloatStatistics stats = new FloatStatistics();
-
-    for (float f: floatArray) {
-      stats.updateStats(f);
-    }
-    assertEquals(stats.getMax(), 553.6f, 1e-10);
-    assertEquals(stats.getMin(), 0.0001f, 1e-10);
-
-    // Test negative values
-    floatArray = new float[] {-1.5f, -44.5f, -412.99f, 0.65f, -5.6f, -100.6f, 0.0001f, -23.0f, -3.6f};
-    FloatStatistics statsNeg = new FloatStatistics();
-
-    for (float f: floatArray) {
-      statsNeg.updateStats(f);
-    }
-    assertEquals(statsNeg.getMax(), 0.65f, 1e-10);
-    assertEquals(statsNeg.getMin(), -412.99f, 1e-10);
-
-    // Test converting to and from byte[]
-    byte[] floatMaxBytes = statsNeg.getMaxBytes();
-    byte[] floatMinBytes = statsNeg.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(floatMaxBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getFloat(), 0.65f, 1e-10);
-    assertEquals(ByteBuffer.wrap(floatMinBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getFloat(), -412.99f, 1e-10);
-
-    FloatStatistics statsFromBytes = new FloatStatistics();
-    statsFromBytes.setMinMaxFromBytes(floatMinBytes, floatMaxBytes);
-
-    assertEquals(statsFromBytes.getMax(), 0.65f, 1e-10);
-    assertEquals(statsFromBytes.getMin(), -412.99f, 1e-10);
-
-    floatArray = new float[] {Float.MAX_VALUE, Float.MIN_VALUE};
-    FloatStatistics minMaxValues = new FloatStatistics();
-
-    for (float f: floatArray) {
-      minMaxValues.updateStats(f);
-    }
-    assertEquals(minMaxValues.getMax(), Float.MAX_VALUE, 1e-10);
-    assertEquals(minMaxValues.getMin(), Float.MIN_VALUE, 1e-10);
-
-    // Test converting to and from byte[] for large and small values
-    byte[] floatMaxBytesMinMax = minMaxValues.getMaxBytes();
-    byte[] floatMinBytesMinMax = minMaxValues.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(floatMaxBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getFloat(), Float.MAX_VALUE, 1e-10);
-    assertEquals(ByteBuffer.wrap(floatMinBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getFloat(), Float.MIN_VALUE, 1e-10);
-
-    FloatStatistics statsFromBytesMinMax= new FloatStatistics();
-    statsFromBytesMinMax.setMinMaxFromBytes(floatMinBytesMinMax, floatMaxBytesMinMax);
-
-    assertEquals(statsFromBytesMinMax.getMax(), Float.MAX_VALUE, 1e-10);
-    assertEquals(statsFromBytesMinMax.getMin(), Float.MIN_VALUE, 1e-10);
-
-    // Test print formatting
-    assertEquals(stats.toString(), "min: 0.00010, max: 553.59998, num_nulls: 0");
-  }
-
-  @Test
-  public void testDoubleMinMax() {
-    // Test basic max/min
-    doubleArray = new double[] {81.5d, 944.5f, 2.002d, 334.5d, 5.6d, 0.001d, 0.00001d, 23.0d, 553.6d};
-    DoubleStatistics stats = new DoubleStatistics();
-
-    for (double d: doubleArray) {
-      stats.updateStats(d);
-    }
-    assertEquals(stats.getMax(), 944.5d, 1e-10);
-    assertEquals(stats.getMin(), 0.00001d, 1e-10);
-
-    // Test negative values
-    doubleArray = new double[] {-81.5d, -944.5d, 2.002d, -334.5d, -5.6d, -0.001d, -0.00001d, 23.0d, -3.6d};
-    DoubleStatistics statsNeg = new DoubleStatistics();
-
-    for (double d: doubleArray) {
-      statsNeg.updateStats(d);
-    }
-    assertEquals(statsNeg.getMax(), 23.0d, 1e-10);
-    assertEquals(statsNeg.getMin(), -944.5d, 1e-10);
-
-    // Test converting to and from byte[]
-    byte[] doubleMaxBytes = statsNeg.getMaxBytes();
-    byte[] doubleMinBytes = statsNeg.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(doubleMaxBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getDouble(), 23.0d, 1e-10);
-    assertEquals(ByteBuffer.wrap(doubleMinBytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getDouble(), -944.5d, 1e-10);
-
-    DoubleStatistics statsFromBytes = new DoubleStatistics();
-    statsFromBytes.setMinMaxFromBytes(doubleMinBytes, doubleMaxBytes);
-
-    assertEquals(statsFromBytes.getMax(), 23.0d, 1e-10);
-    assertEquals(statsFromBytes.getMin(), -944.5d, 1e-10);
-
-    doubleArray = new double[] {Double.MAX_VALUE, Double.MIN_VALUE};
-    DoubleStatistics minMaxValues = new DoubleStatistics();
-
-    for (double d: doubleArray) {
-      minMaxValues.updateStats(d);
-    }
-    assertEquals(minMaxValues.getMax(), Double.MAX_VALUE, 1e-10);
-    assertEquals(minMaxValues.getMin(), Double.MIN_VALUE, 1e-10);
-
-    // Test converting to and from byte[] for large and small values
-    byte[] doubleMaxBytesMinMax = minMaxValues.getMaxBytes();
-    byte[] doubleMinBytesMinMax = minMaxValues.getMinBytes();
-
-    assertEquals(ByteBuffer.wrap(doubleMaxBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getDouble(), Double.MAX_VALUE, 1e-10);
-    assertEquals(ByteBuffer.wrap(doubleMinBytesMinMax).order(java.nio.ByteOrder.LITTLE_ENDIAN).getDouble(), Double.MIN_VALUE, 1e-10);
-
-    DoubleStatistics statsFromBytesMinMax= new DoubleStatistics();
-    statsFromBytesMinMax.setMinMaxFromBytes(doubleMinBytesMinMax, doubleMaxBytesMinMax);
-
-    assertEquals(statsFromBytesMinMax.getMax(), Double.MAX_VALUE, 1e-10);
-    assertEquals(statsFromBytesMinMax.getMin(), Double.MIN_VALUE, 1e-10);
-
-    // Test print formatting
-    assertEquals(stats.toString(), "min: 0.00001, max: 944.50000, num_nulls: 0");
-  }
-
-  @Test
-  public void testBooleanMinMax() {
-    // Test all true
-    booleanArray = new boolean[] {true, true, true};
-    BooleanStatistics statsTrue = new BooleanStatistics();
-
-    for (boolean i: booleanArray) {
-      statsTrue.updateStats(i);
-    }
-    assertTrue(statsTrue.getMax());
-    assertTrue(statsTrue.getMin());
-
-    // Test all false
-    booleanArray = new boolean[] {false, false, false};
-    BooleanStatistics statsFalse = new BooleanStatistics();
-
-    for (boolean i: booleanArray) {
-      statsFalse.updateStats(i);
-    }
-    assertFalse(statsFalse.getMax());
-    assertFalse(statsFalse.getMin());
-
-    booleanArray = new boolean[] {false, true, false};
-    BooleanStatistics statsBoth = new BooleanStatistics();
-
-    for (boolean i: booleanArray) {
-      statsBoth.updateStats(i);
-    }
-    assertTrue(statsBoth.getMax());
-    assertFalse(statsBoth.getMin());
-
-    // Test converting to and from byte[]
-    byte[] boolMaxBytes = statsBoth.getMaxBytes();
-    byte[] boolMinBytes = statsBoth.getMinBytes();
-
-    assertEquals((int)(boolMaxBytes[0] & 255), 1);
-    assertEquals((int)(boolMinBytes[0] & 255), 0);
-
-    BooleanStatistics statsFromBytes = new BooleanStatistics();
-    statsFromBytes.setMinMaxFromBytes(boolMinBytes, boolMaxBytes);
-
-    assertTrue(statsFromBytes.getMax());
-    assertFalse(statsFromBytes.getMin());
-
-    // Test print formatting
-    assertEquals(statsBoth.toString(), "min: false, max: true, num_nulls: 0");
-  }
-
-  @Test
-  public void testBinaryMinMax() {
-    //Test basic max/min
-    stringArray = new String[] {"hello", "world", "this", "is", "a", "test", "of", "the", "stats", "class"};
-    BinaryStatistics stats = new BinaryStatistics();
-
-    for (String s: stringArray) {
-      stats.updateStats(Binary.fromString(s));
-    }
-    assertEquals(stats.getMax(), Binary.fromString("world"));
-    assertEquals(stats.getMin(), Binary.fromString("a"));
-
-    // Test empty string
-    stringArray = new String[] {"", "", "", "", ""};
-    BinaryStatistics statsEmpty = new BinaryStatistics();
-
-    for (String s: stringArray) {
-      statsEmpty.updateStats(Binary.fromString(s));
-    }
-    assertEquals(statsEmpty.getMax(), Binary.fromString(""));
-    assertEquals(statsEmpty.getMin(), Binary.fromString(""));
-
-    // Test converting to and from byte[]
-    byte[] stringMaxBytes = stats.getMaxBytes();
-    byte[] stringMinBytes = stats.getMinBytes();
-
-    assertEquals(new String(stringMaxBytes), "world");
-    assertEquals(new String(stringMinBytes), "a");
-
-    BinaryStatistics statsFromBytes = new BinaryStatistics();
-    statsFromBytes.setMinMaxFromBytes(stringMinBytes, stringMaxBytes);
-
-    assertEquals(statsFromBytes.getMax(), Binary.fromString("world"));
-    assertEquals(statsFromBytes.getMin(), Binary.fromString("a"));
-
-    // Test print formatting
-    assertEquals(stats.toString(), "min: a, max: world, num_nulls: 0");
-  }
-
-  @Test
-  public void testMergingStatistics() {
-    testMergingIntStats();
-    testMergingLongStats();
-    testMergingFloatStats();
-    testMergingDoubleStats();
-    testMergingBooleanStats();
-    testMergingStringStats();
-  }
-
-  private void testMergingIntStats() {
-    integerArray = new int[] {1, 2, 3, 4, 5};
-    IntStatistics intStats = new IntStatistics();
-
-    for (int s: integerArray) {
-      intStats.updateStats(s);
-    }
-
-    integerArray = new int[] {0, 3, 3};
-    IntStatistics intStats2 = new IntStatistics();
-
-    for (int s: integerArray) {
-      intStats2.updateStats(s);
-    }
-    intStats.mergeStatistics(intStats2);
-    assertEquals(intStats.getMax(), 5);
-    assertEquals(intStats.getMin(), 0);
-
-    integerArray = new int[] {-1, -100, 100};
-    IntStatistics intStats3 = new IntStatistics();
-    for (int s: integerArray) {
-      intStats3.updateStats(s);
-    }
-    intStats.mergeStatistics(intStats3);
-
-    assertEquals(intStats.getMax(), 100);
-    assertEquals(intStats.getMin(), -100);
-  }
-
-  private void testMergingLongStats() {
-    longArray = new long[] {1l, 2l, 3l, 4l, 5l};
-    LongStatistics longStats = new LongStatistics();
-
-    for (long s: longArray) {
-      longStats.updateStats(s);
-    }
-
-    longArray = new long[] {0l, 3l, 3l};
-    LongStatistics longStats2 = new LongStatistics();
-
-    for (long s: longArray) {
-      longStats2.updateStats(s);
-    }
-    longStats.mergeStatistics(longStats2);
-    assertEquals(longStats.getMax(), 5l);
-    assertEquals(longStats.getMin(), 0l);
-
-    longArray = new long[] {-1l, -100l, 100l};
-    LongStatistics longStats3 = new LongStatistics();
-    for (long s: longArray) {
-      longStats3.updateStats(s);
-    }
-    longStats.mergeStatistics(longStats3);
-
-    assertEquals(longStats.getMax(), 100l);
-    assertEquals(longStats.getMin(), -100l);
-  }
-
-  private void testMergingFloatStats() {
-    floatArray = new float[] {1.44f, 12.2f, 98.3f, 1.4f, 0.05f};
-    FloatStatistics floatStats = new FloatStatistics();
-
-    for (float s: floatArray) {
-      floatStats.updateStats(s);
-    }
-
-    floatArray = new float[] {0.0001f, 9.9f, 3.1f};
-    FloatStatistics floatStats2 = new FloatStatistics();
-
-    for (float s: floatArray) {
-      floatStats2.updateStats(s);
-    }
-    floatStats.mergeStatistics(floatStats2);
-    assertEquals(floatStats.getMax(), 98.3f, 1e-10);
-    assertEquals(floatStats.getMin(), 0.0001f, 1e-10);
-
-    floatArray = new float[] {-1.91f, -100.9f, 100.54f};
-    FloatStatistics floatStats3 = new FloatStatistics();
-    for (float s: floatArray) {
-      floatStats3.updateStats(s);
-    }
-    floatStats.mergeStatistics(floatStats3);
-
-    assertEquals(floatStats.getMax(), 100.54f, 1e-10);
-    assertEquals(floatStats.getMin(), -100.9f, 1e-10);
-  }
-
-  private void testMergingDoubleStats() {
-    doubleArray = new double[] {1.44d, 12.2d, 98.3d, 1.4d, 0.05d};
-    DoubleStatistics doubleStats = new DoubleStatistics();
-
-    for (double s: doubleArray) {
-      doubleStats.updateStats(s);
-    }
-
-    doubleArray = new double[] {0.0001d, 9.9d, 3.1d};
-    DoubleStatistics doubleStats2 = new DoubleStatistics();
-
-    for (double s: doubleArray) {
-      doubleStats2.updateStats(s);
-    }
-    doubleStats.mergeStatistics(doubleStats2);
-    assertEquals(doubleStats.getMax(), 98.3d, 1e-10);
-    assertEquals(doubleStats.getMin(), 0.0001d, 1e-10);
-
-    doubleArray = new double[] {-1.91d, -100.9d, 100.54d};
-    DoubleStatistics doubleStats3 = new DoubleStatistics();
-    for (double s: doubleArray) {
-      doubleStats3.updateStats(s);
-    }
-    doubleStats.mergeStatistics(doubleStats3);
-
-    assertEquals(doubleStats.getMax(), 100.54d, 1e-10);
-    assertEquals(doubleStats.getMin(), -100.9d, 1e-10);
-  }
-
-  private void testMergingBooleanStats() {
-    booleanArray = new boolean[] {true, true, true};
-    BooleanStatistics booleanStats = new BooleanStatistics();
-
-    for (boolean s: booleanArray) {
-      booleanStats.updateStats(s);
-    }
-
-    booleanArray = new boolean[] {true, false};
-    BooleanStatistics booleanStats2 = new BooleanStatistics();
-
-    for (boolean s: booleanArray) {
-      booleanStats2.updateStats(s);
-    }
-    booleanStats.mergeStatistics(booleanStats2);
-    assertEquals(booleanStats.getMax(), true);
-    assertEquals(booleanStats.getMin(), false);
-
-    booleanArray = new boolean[] {false, false, false, false};
-    BooleanStatistics booleanStats3 = new BooleanStatistics();
-    for (boolean s: booleanArray) {
-      booleanStats3.updateStats(s);
-    }
-    booleanStats.mergeStatistics(booleanStats3);
-
-    assertEquals(booleanStats.getMax(), true);
-    assertEquals(booleanStats.getMin(), false);
-  }
-
-  private void testMergingStringStats() {
-    stringArray = new String[] {"hello", "world", "this", "is", "a", "test", "of", "the", "stats", "class"};
-    BinaryStatistics stats = new BinaryStatistics();
-
-    for (String s: stringArray) {
-      stats.updateStats(Binary.fromString(s));
-    }
-
-    stringArray = new String[] {"zzzz", "asdf", "testing"};
-    BinaryStatistics stats2 = new BinaryStatistics();
-
-    for (String s: stringArray) {
-      stats2.updateStats(Binary.fromString(s));
-    }
-    stats.mergeStatistics(stats2);
-    assertEquals(stats.getMax(), Binary.fromString("zzzz"));
-    assertEquals(stats.getMin(), Binary.fromString("a"));
-
-    stringArray = new String[] {"", "good", "testing"};
-    BinaryStatistics stats3 = new BinaryStatistics();
-    for (String s: stringArray) {
-      stats3.updateStats(Binary.fromString(s));
-    }
-    stats.mergeStatistics(stats3);
-
-    assertEquals(stats.getMax(), Binary.fromString("zzzz"));
-    assertEquals(stats.getMin(), Binary.fromString(""));
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/RandomStr.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/RandomStr.java b/parquet-column/src/test/java/parquet/column/values/RandomStr.java
deleted file mode 100644
index 7b8a96b..0000000
--- a/parquet-column/src/test/java/parquet/column/values/RandomStr.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
- * 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 parquet.column.values;
-
-import java.util.Random;
-
-/**
- * 
- * @author Aniket Mokashi
- *
- */
-public class RandomStr {
-  private final char[] alphanumeric=alphanumeric();
-  private final Random rand;
-
-  public RandomStr(){this(null);}
-
-  public RandomStr(Random rand){
-    this.rand=(rand!=null) ? rand : new Random();
-  }
-
-  public String get(int len){
-    StringBuffer out=new StringBuffer();
-
-    while(out.length() < len){
-      int idx=Math.abs(( rand.nextInt() % alphanumeric.length ));
-      out.append(alphanumeric[idx]);
-    }
-    return out.toString();
-  }
-
-  // create alphanumeric char array
-  private char[] alphanumeric(){
-    StringBuffer buf=new StringBuffer(128);
-    for(int i=48; i<= 57;i++)buf.append((char)i); // 0-9
-    for(int i=65; i<= 90;i++)buf.append((char)i); // A-Z
-    for(int i=97; i<=122;i++)buf.append((char)i); // a-z
-    return buf.toString().toCharArray();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/Utils.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/Utils.java b/parquet-column/src/test/java/parquet/column/values/Utils.java
deleted file mode 100644
index 42a9d42..0000000
--- a/parquet-column/src/test/java/parquet/column/values/Utils.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/* 
- * 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 parquet.column.values;
-
-import java.io.IOException;
-import java.util.Random;
-
-import parquet.io.api.Binary;
-
-/**
- * Test Utility class
- * 
- * @author Aniket Mokashi
- *
- */
-public class Utils {
-  private static Random randomLen = new Random();
-  private static RandomStr randomStr = new RandomStr(randomLen);
-  
-  public static String[] getRandomStringSamples(int numSamples, int maxLength) {
-    String[] samples = new String[numSamples];
-    
-    for (int i=0; i < numSamples; i++) {
-      int len = randomLen.nextInt(maxLength);
-      samples[i] = randomStr.get(len);
-    }
-    
-    return samples;
-  }
-  
-  public static void writeInts(ValuesWriter writer, int[] ints)
-      throws IOException {
-    for(int i=0; i < ints.length; i++) {
-      writer.writeInteger(ints[i]);
-    }
-  }
-
-  public static void writeData(ValuesWriter writer, String[] strings)
-      throws IOException {
-    for(int i=0; i < strings.length; i++) {
-      writer.writeBytes(Binary.fromString(strings[i]));
-    }
-  }
-
-  public static Binary[] readData(ValuesReader reader, byte[] data, int offset, int length)
-      throws IOException {
-    Binary[] bins = new Binary[length];
-    reader.initFromPage(length, data, 0);
-    for(int i=0; i < length; i++) {
-      bins[i] = reader.readBytes();
-    }
-    return bins;
-  }
-  
-  public static Binary[] readData(ValuesReader reader, byte[] data, int length)
-      throws IOException {
-    return readData(reader, data, 0, length);
-  }
-  
-  public static int[] readInts(ValuesReader reader, byte[] data, int offset, int length)
-      throws IOException {
-    int[] ints = new int[length];
-    reader.initFromPage(length, data, offset);
-    for(int i=0; i < length; i++) {
-      ints[i] = reader.readInteger();
-    }
-    return ints;
-  }
-  
-  public static int[] readInts(ValuesReader reader, byte[] data, int length)
-      throws IOException {
-    return readInts(reader, data, 0, length);
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/bitpacking/BitPackingPerfTest.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/bitpacking/BitPackingPerfTest.java b/parquet-column/src/test/java/parquet/column/values/bitpacking/BitPackingPerfTest.java
deleted file mode 100644
index 93f9a56..0000000
--- a/parquet-column/src/test/java/parquet/column/values/bitpacking/BitPackingPerfTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* 
- * 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 parquet.column.values.bitpacking;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import parquet.column.values.ValuesReader;
-import parquet.column.values.bitpacking.BitPacking.BitPackingWriter;
-
-/**
- * Improvable micro benchmark for bitpacking
- * run with: -verbose:gc -Xmx2g -Xms2g
- * @author Julien Le Dem
- *
- */
-public class BitPackingPerfTest {
-
-  public static void main(String[] args) throws IOException {
-    int COUNT = 800000;
-    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-    BitPackingWriter w = BitPacking.getBitPackingWriter(1, baos);
-    long t0 = System.currentTimeMillis();
-    for (int i = 0 ; i < COUNT; ++i) {
-      w.write(i % 2);
-    }
-    w.finish();
-    long t1 = System.currentTimeMillis();
-    System.out.println("written in " + (t1 - t0) + "ms");
-    System.out.println();
-    byte[] bytes = baos.toByteArray();
-    System.out.println(bytes.length);
-    int[] result = new int[COUNT];
-    for (int l = 0; l < 5; l++) {
-      long s = manual(bytes, result);
-      long b = generated(bytes, result);
-      float ratio = (float)b/s;
-      System.out.println("                                             " + ratio + (ratio < 1 ? " < 1 => GOOD" : " >= 1 => BAD"));
-    }
-  }
-
-  private static void verify(int[] result) {
-    int error = 0;
-    for (int i = 0 ; i < result.length; ++i) {
-      if (result[i] != i % 2) {
-        error ++;
-      }
-    }
-    if (error != 0) {
-      throw new RuntimeException("errors: " + error + " / " + result.length);
-    }
-  }
-
-  private static long manual(byte[] bytes, int[] result)
-      throws IOException {
-    return readNTimes(bytes, result, new BitPackingValuesReader(1));
-  }
-
-  private static long generated(byte[] bytes, int[] result)
-      throws IOException {
-    return readNTimes(bytes, result, new ByteBitPackingValuesReader(1, Packer.BIG_ENDIAN));
-  }
-
-  private static long readNTimes(byte[] bytes, int[] result, ValuesReader r)
-      throws IOException {
-    System.out.println();
-    long t = 0;
-    int N = 10;
-    System.gc();
-    System.out.print("                                             " + r.getClass().getSimpleName());
-    System.out.print(" no gc <");
-    for (int k = 0; k < N; k++) {
-      long t2 = System.nanoTime();
-      r.initFromPage(result.length, bytes, 0);
-      for (int i = 0; i < result.length; i++) {
-        result[i] = r.readInteger();
-      }
-      long t3 = System.nanoTime();
-      t += t3 - t2;
-    }
-    System.out.println("> read in " + t/1000 + "µs " + (N * result.length / (t / 1000)) + " values per µs");
-    verify(result);
-    return t;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/bitpacking/TestBitPackingColumn.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/bitpacking/TestBitPackingColumn.java b/parquet-column/src/test/java/parquet/column/values/bitpacking/TestBitPackingColumn.java
deleted file mode 100644
index 7fd89d5..0000000
--- a/parquet-column/src/test/java/parquet/column/values/bitpacking/TestBitPackingColumn.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/* 
- * 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 parquet.column.values.bitpacking;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static parquet.column.values.bitpacking.Packer.BIG_ENDIAN;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-import parquet.Log;
-import parquet.column.values.ValuesReader;
-import parquet.column.values.ValuesWriter;
-
-public class TestBitPackingColumn {
-  private static final Log LOG = Log.getLog(TestBitPackingColumn.class);
-
-  @Test
-  public void testZero() throws IOException {
-    int bitLength = 0;
-    int[] vals = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-    String expected = "";
-    validateEncodeDecode(bitLength, vals, expected);
-  }
-
-  @Test
-  public void testOne_0() throws IOException {
-    int[] vals = {0};
-    String expected = "00000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_1() throws IOException {
-    int[] vals = {1};
-    String expected = "10000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_0_0() throws IOException {
-    int[] vals = {0, 0};
-    String expected = "00000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_1_1() throws IOException {
-    int[] vals = {1, 1};
-    String expected = "11000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_9_1s() throws IOException {
-    int[] vals = {1, 1, 1, 1, 1, 1, 1, 1, 1};
-    String expected = "11111111 10000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_9_0s() throws IOException {
-    int[] vals = {0, 0, 0, 0, 0, 0, 0, 0, 0};
-    String expected = "00000000 00000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_7_0s_1_1() throws IOException {
-    int[] vals = {0, 0, 0, 0, 0, 0, 0, 1};
-    String expected = "00000001";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne_9_0s_1_1() throws IOException {
-    int[] vals = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
-    String expected = "00000000 01000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testOne() throws IOException {
-    int[] vals = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1};
-    String expected = "01001110 01000000";
-    validateEncodeDecode(1, vals, expected);
-  }
-
-  @Test
-  public void testTwo() throws IOException {
-    int[] vals = {0, 1, 2, 3, 3, 3, 2, 1, 1, 0, 0, 0, 1};
-    String expected = "00011011 11111001 01000000 01000000";
-    validateEncodeDecode(2, vals, expected);
-  }
-
-  @Test
-  public void testThree() throws IOException {
-    int[] vals = {0, 1, 2, 3, 4, 5, 6, 7, 1};
-    String expected =
-        "00000101 00111001 01110111 " +
-        "00100000";
-    validateEncodeDecode(3, vals, expected);
-  }
-
-  @Test
-  public void testFour() throws IOException {
-    int[] vals = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1};
-    String expected = "00000001 00100011 01000101 01100111 10001001 10101011 11001101 11101111 00010000";
-    validateEncodeDecode(4, vals, expected);
-  }
-
-  @Test
-  public void testFive() throws IOException {
-    int[] vals = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1};
-    String expected =
-        "00000000 01000100 00110010 00010100 11000111 " +
-        "01000010 01010100 10110110 00110101 11001111 " +
-        "10000100 01100101 00111010 01010110 11010111 " +
-        "11000110 01110101 10111110 01110111 11011111 " +
-        "00001000";
-    validateEncodeDecode(5, vals, expected);
-  }
-
-  @Test
-  public void testSix() throws IOException {
-    int[] vals = { 0, 28, 34, 35, 63, 1};
-    // 000000, 011100, 100010, 100011, 111111, 000001
-    String expected =
-        "00000001 11001000 10100011 " +
-        "11111100 00010000";
-    validateEncodeDecode(6, vals, expected);
-  }
-
-  @Test
-  public void testSeven() throws IOException {
-    int[] vals = { 0, 28, 34, 35, 63, 1, 125, 1, 1};
-    // 0000000, 0011100, 0100010, 0100011, 0111111, 0000001, 1111101, 0000001, 0000001
-    String expected =
-        "00000000 01110001 00010010 00110111 11100000 01111110 10000001 " +
-        "00000010";
-    validateEncodeDecode(7, vals, expected);
-  }
-
-  private void validateEncodeDecode(int bitLength, int[] vals, String expected) throws IOException {
-    for (PACKING_TYPE type : PACKING_TYPE.values()) {
-      LOG.debug(type);
-      final int bound = (int)Math.pow(2, bitLength) - 1;
-      ValuesWriter w = type.getWriter(bound);
-      for (int i : vals) {
-        w.writeInteger(i);
-      }
-      byte[] bytes = w.getBytes().toByteArray();
-      LOG.debug("vals ("+bitLength+"): " + TestBitPacking.toString(vals));
-      LOG.debug("bytes: " + TestBitPacking.toString(bytes));
-      assertEquals(type.toString(), expected, TestBitPacking.toString(bytes));
-      ValuesReader r = type.getReader(bound);
-      r.initFromPage(vals.length, bytes, 0);
-      int[] result = new int[vals.length];
-      for (int i = 0; i < result.length; i++) {
-        result[i] = r.readInteger();
-      }
-      LOG.debug("result: " + TestBitPacking.toString(result));
-      assertArrayEquals(type + " result: " + TestBitPacking.toString(result), vals, result);
-    }
-  }
-
-  private static enum PACKING_TYPE {
-    BYTE_BASED_MANUAL {
-      public ValuesReader getReader(final int bound) {
-        return new BitPackingValuesReader(bound);
-      }
-      public ValuesWriter getWriter(final int bound) {
-        return new BitPackingValuesWriter(bound, 32*1024, 64*1024);
-      }
-    }
-    ,
-    BYTE_BASED_GENERATED {
-      public ValuesReader getReader(final int bound) {
-        return new ByteBitPackingValuesReader(bound, BIG_ENDIAN);
-      }
-      public ValuesWriter getWriter(final int bound) {
-        return new ByteBitPackingValuesWriter(bound, BIG_ENDIAN);
-      }
-    }
-    ;
-    abstract public ValuesReader getReader(final int bound);
-    abstract public ValuesWriter getWriter(final int bound);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/boundedint/TestBoundedColumns.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/boundedint/TestBoundedColumns.java b/parquet-column/src/test/java/parquet/column/values/boundedint/TestBoundedColumns.java
deleted file mode 100644
index e2d6913..0000000
--- a/parquet-column/src/test/java/parquet/column/values/boundedint/TestBoundedColumns.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* 
- * 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 parquet.column.values.boundedint;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Random;
-
-import org.junit.Test;
-
-import parquet.column.values.boundedint.BoundedIntValuesReader;
-import parquet.column.values.boundedint.BoundedIntValuesWriter;
-
-public class TestBoundedColumns {
-  private final Random r = new Random(42L);
-
-  @Test
-  public void testWriterRepeatNoRepeatAndRepeatUnderThreshold() throws IOException {
-    int[] ints = {
-        1, 1, 1, 1,
-        0,
-        0,
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 16 2s
-        1,
-        5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 // 24 5s
-        };
-    String[] result = {"1",b(1,3),b(4),"0",b(0,3),"0",b(0,3),"1",b(2,3),b(16),"0",b(1,3),"1",b(5,3),b(24)};
-    compareOutput(7, ints, result);
-  }
-
-  @Test
-  public void testWriterNoRepeat() throws IOException {
-    int bound = 7;
-    int[] ints = { 0, 1, 2, 3, 4, 5, 6, 7};
-    String[] result = {"0",b(0,3),"0",b(1,3),"0",b(2,3),"0",b(3,3),"0",b(4,3),"0",b(5,3),"0",b(6,3),"0",b(7,3)};
-    compareOutput(bound, ints, result);
-  }
-
-  private void compareOutput(int bound, int[] ints, String[] result) throws IOException {
-    BoundedIntValuesWriter bicw = new BoundedIntValuesWriter(bound, 64*1024, 64*1024);
-    for (int i : ints) {
-      bicw.writeInteger(i);
-    }
-    System.out.println(Arrays.toString(ints));
-    System.out.println(Arrays.toString(result));
-    byte[] byteArray = bicw.getBytes().toByteArray();
-    assertEquals(concat(result), toBinaryString(byteArray, 4));
-    BoundedIntValuesReader bicr = new BoundedIntValuesReader(bound);
-    bicr.initFromPage(1, byteArray, 0);
-    String expected = "";
-    String got = "";
-    for (int i : ints) {
-      expected += " " + i;
-      got += " " + bicr.readInteger();
-    }
-    assertEquals(expected, got);
-  }
-
-  private String concat(String[] result) {
-    String r = "";
-    for (String string : result) {
-      r = string + r;
-    }
-    return r;
-  }
-
-  private String b(int i) {
-    return b(i,8);
-  }
-
-  private String b(int i, int size) {
-    String binaryString = Integer.toBinaryString(i);
-    while (binaryString.length() < size) {
-      binaryString = "0" + binaryString;
-    }
-    return binaryString;
-  }
-
-  public static String toBinaryString(byte[] bytes) {
-    return toBinaryString(bytes, 0);
-  }
-
-  private static String toBinaryString(byte[] bytes, int offset) {
-    String result = "";
-    for (int i = offset; i < bytes.length; i++) {
-      int b = bytes[i] < 0 ? 256 + bytes[i] : bytes[i];
-      String binaryString = Integer.toBinaryString(b);
-      while (binaryString.length() < 8) {
-        binaryString = "0" + binaryString;
-      }
-      result = binaryString + result;
-    }
-    return result;
-  }
-
-  @Test
-  public void testSerDe() throws Exception {
-    int[] valuesPerStripe = new int[] { 50, 100, 700, 1, 200 };
-    int totalValuesInStream = 0;
-    for (int v : valuesPerStripe) {
-      totalValuesInStream += v * 2;
-    }
-
-    for (int bound = 1; bound < 8; bound++) {
-      System.out.println("bound: "+ bound);
-      ByteArrayOutputStream tmp = new ByteArrayOutputStream();
-
-      int[] stream = new int[totalValuesInStream];
-      BoundedIntValuesWriter bicw = new BoundedIntValuesWriter(bound, 64 * 1024, 64*1024);
-      int idx = 0;
-      for (int stripeNum = 0; stripeNum < valuesPerStripe.length; stripeNum++) {
-        int next = 0;
-        for (int i = 0; i < valuesPerStripe[stripeNum]; i++) {
-          int temp = r.nextInt(bound + 1);
-          while (next == temp) {
-            temp = r.nextInt(bound + 1);
-          }
-          next = temp;
-          stream[idx++] = next;
-          int ct;
-          if (r.nextBoolean()) {
-            stream[idx++] = ct = r.nextInt(1000) + 1;
-          } else {
-            stream[idx++] = ct = 1;
-          }
-          for (int j = 0; j < ct; j++) {
-            bicw.writeInteger(next);
-          }
-        }
-        bicw.getBytes().writeAllTo(tmp);
-        bicw.reset();
-      }
-      tmp.close();
-
-      byte[] input = tmp.toByteArray();
-
-      BoundedIntValuesReader bicr = new BoundedIntValuesReader(bound);
-      idx = 0;
-      int offset = 0;
-      for (int stripeNum = 0; stripeNum < valuesPerStripe.length; stripeNum++) {
-        bicr.initFromPage(1, input, offset);
-        offset = bicr.getNextOffset();
-        for (int i = 0; i < valuesPerStripe[stripeNum]; i++) {
-          int number = stream[idx++];
-          int ct = stream[idx++];
-          assertTrue(number <= bound);
-          assertTrue(ct > 0);
-          for (int j = 0; j < ct; j++) {
-            assertEquals("Failed on bound ["+bound+"], stripe ["+stripeNum+"], iteration ["+i+"], on count ["+ct+"]", number, bicr.readInteger());
-          }
-        }
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/delta/DeltaBinaryPackingValuesWriterTest.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/delta/DeltaBinaryPackingValuesWriterTest.java b/parquet-column/src/test/java/parquet/column/values/delta/DeltaBinaryPackingValuesWriterTest.java
deleted file mode 100644
index 79af39d..0000000
--- a/parquet-column/src/test/java/parquet/column/values/delta/DeltaBinaryPackingValuesWriterTest.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/* 
- * 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 parquet.column.values.delta;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Random;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import parquet.bytes.BytesInput;
-import parquet.column.values.ValuesWriter;
-import parquet.io.ParquetDecodingException;
-
-public class DeltaBinaryPackingValuesWriterTest {
-  DeltaBinaryPackingValuesReader reader;
-  private int blockSize;
-  private int miniBlockNum;
-  private ValuesWriter writer;
-  private Random random;
-
-  @Before
-  public void setUp() {
-    blockSize = 128;
-    miniBlockNum = 4;
-    writer = new DeltaBinaryPackingValuesWriter(blockSize, miniBlockNum, 100, 200);
-    random = new Random();
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void miniBlockSizeShouldBeMultipleOf8() {
-    new DeltaBinaryPackingValuesWriter(1281, 4, 100, 100);
-  }
-
-  /* When data size is multiple of Block*/
-  @Test
-  public void shouldWriteWhenDataIsAlignedWithBlock() throws IOException {
-    int[] data = new int[5 * blockSize];
-    for (int i = 0; i < blockSize * 5; i++) {
-      data[i] = random.nextInt();
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteAndReadWhenBlockIsNotFullyWritten() throws IOException {
-    int[] data = new int[blockSize - 3];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = random.nextInt();
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteAndReadWhenAMiniBlockIsNotFullyWritten() throws IOException {
-    int miniBlockSize = blockSize / miniBlockNum;
-    int[] data = new int[miniBlockSize - 3];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = random.nextInt();
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteNegativeDeltas() throws IOException {
-    int[] data = new int[blockSize];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = 10 - (i * 32 - random.nextInt(6));
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteAndReadWhenDeltasAreSame() throws IOException {
-    int[] data = new int[2 * blockSize];
-    for (int i = 0; i < blockSize; i++) {
-      data[i] = i * 32;
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteAndReadWhenValuesAreSame() throws IOException {
-    int[] data = new int[2 * blockSize];
-    for (int i = 0; i < blockSize; i++) {
-      data[i] = 3;
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldWriteWhenDeltaIs0ForEachBlock() throws IOException {
-    int[] data = new int[5 * blockSize + 1];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = (i - 1) / blockSize;
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldReadWriteWhenDataIsNotAlignedWithBlock() throws IOException {
-    int[] data = new int[5 * blockSize + 3];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = random.nextInt(20) - 10;
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldReadMaxMinValue() throws IOException {
-    int[] data = new int[10];
-    for (int i = 0; i < data.length; i++) {
-      if(i%2==0) {
-        data[i]=Integer.MIN_VALUE;
-      }else {
-        data[i]=Integer.MAX_VALUE;
-      }
-    }
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void shouldReturnCorrectOffsetAfterInitialization() throws IOException {
-    int[] data = new int[2 * blockSize + 3];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = i * 32;
-    }
-    writeData(data);
-
-    reader = new DeltaBinaryPackingValuesReader();
-    BytesInput bytes = writer.getBytes();
-    byte[] valueContent = bytes.toByteArray();
-    byte[] pageContent = new byte[valueContent.length * 10];
-    int contentOffsetInPage = 33;
-    System.arraycopy(valueContent, 0, pageContent, contentOffsetInPage, valueContent.length);
-
-    //offset should be correct
-    reader.initFromPage(100, pageContent, contentOffsetInPage);
-    int offset= reader.getNextOffset();
-    assertEquals(valueContent.length + contentOffsetInPage, offset);
-
-    //should be able to read data correclty
-    for (int i : data) {
-      assertEquals(i, reader.readInteger());
-    }
-  }
-
-  @Test
-  public void shouldThrowExceptionWhenReadMoreThanWritten() throws IOException {
-    int[] data = new int[5 * blockSize + 1];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = i * 32;
-    }
-    shouldWriteAndRead(data);
-    try {
-      reader.readInteger();
-    } catch (ParquetDecodingException e) {
-      assertEquals("no more value to read, total value count is " + data.length, e.getMessage());
-    }
-
-  }
-
-  @Test
-  public void shouldSkip() throws IOException {
-    int[] data = new int[5 * blockSize + 1];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = i * 32;
-    }
-    writeData(data);
-    reader = new DeltaBinaryPackingValuesReader();
-    reader.initFromPage(100, writer.getBytes().toByteArray(), 0);
-    for (int i = 0; i < data.length; i++) {
-      if (i % 3 == 0) {
-        reader.skip();
-      } else {
-        assertEquals(i * 32, reader.readInteger());
-      }
-    }
-  }
-
-  @Test
-  public void shouldReset() throws IOException {
-    shouldReadWriteWhenDataIsNotAlignedWithBlock();
-    int[] data = new int[5 * blockSize];
-    for (int i = 0; i < blockSize * 5; i++) {
-      data[i] = i * 2;
-    }
-    writer.reset();
-    shouldWriteAndRead(data);
-  }
-
-  @Test
-  public void randomDataTest() throws IOException {
-    int maxSize = 1000;
-    int[] data = new int[maxSize];
-
-    for (int round = 0; round < 100000; round++) {
-
-
-      int size = random.nextInt(maxSize);
-
-      for (int i = 0; i < size; i++) {
-        data[i] = random.nextInt();
-      }
-      shouldReadAndWrite(data, size);
-      writer.reset();
-    }
-  }
-
-  private void shouldWriteAndRead(int[] data) throws IOException {
-    shouldReadAndWrite(data, data.length);
-  }
-
-  private void shouldReadAndWrite(int[] data, int length) throws IOException {
-    writeData(data, length);
-    reader = new DeltaBinaryPackingValuesReader();
-    byte[] page = writer.getBytes().toByteArray();
-    int miniBlockSize = blockSize / miniBlockNum;
-
-    double miniBlockFlushed = Math.ceil(((double) length - 1) / miniBlockSize);
-    double blockFlushed = Math.ceil(((double) length - 1) / blockSize);
-    double estimatedSize = 4 * 5 //blockHeader
-        + 4 * miniBlockFlushed * miniBlockSize //data(aligned to miniBlock)
-        + blockFlushed * miniBlockNum //bitWidth of mini blocks
-        + (5.0 * blockFlushed);//min delta for each block
-    assertTrue(estimatedSize >= page.length);
-    reader.initFromPage(100, page, 0);
-
-    for (int i = 0; i < length; i++) {
-      assertEquals(data[i], reader.readInteger());
-    }
-  }
-
-  private void writeData(int[] data) {
-    writeData(data, data.length);
-  }
-
-  private void writeData(int[] data, int length) {
-    for (int i = 0; i < length; i++) {
-      writer.writeInteger(data[i]);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchMarkTest.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchMarkTest.java b/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchMarkTest.java
deleted file mode 100644
index 3e2a0ee..0000000
--- a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchMarkTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * 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 parquet.column.values.delta.benchmark;
-
-import parquet.column.values.ValuesWriter;
-
-public abstract class BenchMarkTest {
-  public static int[] data;
-
-  protected void runWriteTest(ValuesWriter writer){
-    int pageCount = 10;
-    double avg = 0.0;
-    for (int i = 0; i < pageCount ; i++) {
-      writer.reset();
-      long startTime = System.nanoTime();
-      for(int item:data){
-        writer.writeInteger(item);
-      }
-      long endTime = System.nanoTime();
-      long duration = endTime - startTime;
-      avg += (double) duration / pageCount;
-    }
-
-    System.out.println("size is "+writer.getBytes().size());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkIntegerOutputSize.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkIntegerOutputSize.java b/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkIntegerOutputSize.java
deleted file mode 100644
index cce4f38..0000000
--- a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkIntegerOutputSize.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* 
- * 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 parquet.column.values.delta.benchmark;
-
-import org.junit.Test;
-import parquet.column.values.delta.DeltaBinaryPackingValuesWriter;
-import parquet.column.values.rle.RunLengthBitPackingHybridValuesWriter;
-import java.util.Random;
-
-public class BenchmarkIntegerOutputSize {
-  public static int blockSize=128;
-  public static int miniBlockNum=4;
-  public static int dataSize=10000 * blockSize;
-
-  private interface IntFunc {
-    public int getIntValue();
-  }
-
-  @Test
-  public void testBigNumbers() {
-    final Random r=new Random();
-    testRandomIntegers(new IntFunc() {
-      @Override
-      public int getIntValue() {
-        return r.nextInt();
-      }
-    },32);
-  }
-
-  @Test
-  public void testRangedNumbersWithSmallVariations() {
-    final Random r=new Random();
-    testRandomIntegers(new IntFunc() {
-      @Override
-      public int getIntValue() {
-        return 1000+r.nextInt(20);
-      }
-    },10);
-  }
-
-  @Test
-  public void testSmallNumbersWithSmallVariations() {
-    final Random r=new Random();
-    testRandomIntegers(new IntFunc() {
-      @Override
-      public int getIntValue() {
-        return 40+r.nextInt(20);
-      }
-    },6);
-  }
-
-  @Test
-  public void testSmallNumberVariation() {
-      final Random r=new Random();
-      testRandomIntegers(new IntFunc() {
-        @Override
-        public int getIntValue() {
-          return r.nextInt(20)-10;
-        }
-      },4);
-  }
-
-  public void testRandomIntegers(IntFunc func,int bitWidth) {
-    DeltaBinaryPackingValuesWriter delta=new DeltaBinaryPackingValuesWriter(blockSize,miniBlockNum, 100, 20000);
-    RunLengthBitPackingHybridValuesWriter rle= new RunLengthBitPackingHybridValuesWriter(bitWidth, 100, 20000);
-    for (int i = 0; i < dataSize; i++) {
-      int v = func.getIntValue();
-      delta.writeInteger(v);
-      rle.writeInteger(v);
-    }
-    System.out.println("delta size: "+delta.getBytes().size());
-    System.out.println("estimated size"+estimatedSize());
-    System.out.println("rle size: "+rle.getBytes().size());
-  }
-
-  private double estimatedSize(){
-    int miniBlockSize = blockSize / miniBlockNum;
-    double miniBlockFlushed = Math.ceil(((double) dataSize - 1) / miniBlockSize);
-    double blockFlushed = Math.ceil(((double) dataSize - 1) / blockSize);
-    double estimatedSize = 4 * 5 //blockHeader
-            + 4 * miniBlockFlushed * miniBlockSize //data(aligned to miniBlock)
-            + blockFlushed * miniBlockNum //bitWidth of mini blocks
-            + (5.0 * blockFlushed);//min delta for each block
-    return estimatedSize;
-  }
-}

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkReadingRandomIntegers.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkReadingRandomIntegers.java b/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkReadingRandomIntegers.java
deleted file mode 100644
index 245769d..0000000
--- a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/BenchmarkReadingRandomIntegers.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* 
- * 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 parquet.column.values.delta.benchmark;
-
-import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
-import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
-import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import parquet.column.values.ValuesReader;
-import parquet.column.values.ValuesWriter;
-import parquet.column.values.delta.DeltaBinaryPackingValuesReader;
-import parquet.column.values.delta.DeltaBinaryPackingValuesWriter;
-import parquet.column.values.rle.RunLengthBitPackingHybridValuesReader;
-import parquet.column.values.rle.RunLengthBitPackingHybridValuesWriter;
-
-import java.io.IOException;
-import java.util.Random;
-
-@AxisRange(min = 0, max = 1)
-@BenchmarkMethodChart(filePrefix = "benchmark-encoding-reading-random")
-public class BenchmarkReadingRandomIntegers {
-  public static int blockSize = 128;
-  public static int miniBlockNum = 4;
-  public static byte[] deltaBytes;
-  public static byte[] rleBytes;
-  public static int[] data;
-  @Rule
-  public org.junit.rules.TestRule benchmarkRun = new BenchmarkRule();
-
-  @BeforeClass
-  public static void prepare() throws IOException {
-    Random random = new Random();
-    data = new int[100000 * blockSize];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = random.nextInt(100) - 200;
-    }
-
-    ValuesWriter delta = new DeltaBinaryPackingValuesWriter(blockSize, miniBlockNum, 100, 20000);
-    ValuesWriter rle = new RunLengthBitPackingHybridValuesWriter(32, 100, 20000);
-
-    for (int i = 0; i < data.length; i++) {
-      delta.writeInteger(data[i]);
-      rle.writeInteger(data[i]);
-    }
-    deltaBytes = delta.getBytes().toByteArray();
-    rleBytes = rle.getBytes().toByteArray();
-  }
-
-  @BenchmarkOptions(benchmarkRounds = 20, warmupRounds = 10)
-  @Test
-  public void readingDelta() throws IOException {
-    for (int j = 0; j < 10; j++) {
-
-      DeltaBinaryPackingValuesReader reader = new DeltaBinaryPackingValuesReader();
-      readData(reader, deltaBytes);
-    }
-  }
-
-  @BenchmarkOptions(benchmarkRounds = 20, warmupRounds = 10)
-  @Test
-  public void readingRLE() throws IOException {
-    for (int j = 0; j < 10; j++) {
-
-      ValuesReader reader = new RunLengthBitPackingHybridValuesReader(32);
-      readData(reader, rleBytes);
-    }
-  }
-
-  private void readData(ValuesReader reader, byte[] deltaBytes) throws IOException {
-    reader.initFromPage(data.length, deltaBytes, 0);
-    for (int i = 0; i < data.length; i++) {
-      reader.readInteger();
-    }
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/b10870e4/parquet-column/src/test/java/parquet/column/values/delta/benchmark/RandomWritingBenchmarkTest.java
----------------------------------------------------------------------
diff --git a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/RandomWritingBenchmarkTest.java b/parquet-column/src/test/java/parquet/column/values/delta/benchmark/RandomWritingBenchmarkTest.java
deleted file mode 100644
index 15fb130..0000000
--- a/parquet-column/src/test/java/parquet/column/values/delta/benchmark/RandomWritingBenchmarkTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* 
- * 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 parquet.column.values.delta.benchmark;
-
-import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
-import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
-import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import parquet.column.values.ValuesWriter;
-import parquet.column.values.delta.DeltaBinaryPackingValuesWriter;
-import parquet.column.values.rle.RunLengthBitPackingHybridValuesWriter;
-import java.util.Random;
-
-@AxisRange(min = 0, max = 1)
-@BenchmarkMethodChart(filePrefix = "benchmark-encoding-writing-random")
-public class RandomWritingBenchmarkTest extends BenchMarkTest{
-  public static int blockSize=128;
-  public static int miniBlockNum=4;
-  @Rule
-  public org.junit.rules.TestRule benchmarkRun = new BenchmarkRule();
-
-  @BeforeClass
-  public static void prepare() {
-    Random random=new Random();
-    data = new int[10000 * blockSize];
-    for (int i = 0; i < data.length; i++) {
-      data[i] = random.nextInt(100) - 200;
-    }
-  }
-
-  @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 2)
-  @Test
-  public void writeDeltaPackingTest(){
-    DeltaBinaryPackingValuesWriter writer = new DeltaBinaryPackingValuesWriter(blockSize, miniBlockNum, 100, 20000);
-    runWriteTest(writer);
-  }
-
-  @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 2)
-  @Test
-  public void writeRLETest(){
-    ValuesWriter writer = new RunLengthBitPackingHybridValuesWriter(32, 100, 20000);
-    runWriteTest(writer);
-  }
-
-  @BenchmarkOptions(benchmarkRounds = 10, warmupRounds = 2)
-  @Test
-  public void writeDeltaPackingTest2(){
-    DeltaBinaryPackingValuesWriter writer = new DeltaBinaryPackingValuesWriter(blockSize, miniBlockNum, 100, 20000);
-    runWriteTest(writer);
-  }
-}


Mime
View raw message