Return-Path: X-Original-To: apmail-tajo-commits-archive@minotaur.apache.org Delivered-To: apmail-tajo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A355106CD for ; Wed, 3 Dec 2014 05:30:17 +0000 (UTC) Received: (qmail 59584 invoked by uid 500); 3 Dec 2014 05:30:16 -0000 Delivered-To: apmail-tajo-commits-archive@tajo.apache.org Received: (qmail 59523 invoked by uid 500); 3 Dec 2014 05:30:16 -0000 Mailing-List: contact commits-help@tajo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.apache.org Delivered-To: mailing list commits@tajo.apache.org Received: (qmail 59496 invoked by uid 99); 3 Dec 2014 05:30:16 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2014 05:30:16 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 268C5A077ED; Wed, 3 Dec 2014 05:30:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hjkim@apache.org To: commits@tajo.apache.org Date: Wed, 03 Dec 2014 05:30:18 -0000 Message-Id: <72f9a2caf10141c3ae56ffe98ccb53d4@git.apache.org> In-Reply-To: <5912497907094a69ad14fc86c9c0cea3@git.apache.org> References: <5912497907094a69ad14fc86c9c0cea3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/30] tajo git commit: TAJO-1122: Refactor the tajo-storage project structure. http://git-wip-us.apache.org/repos/asf/tajo/blob/dfd7f996/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/thirdparty/parquet/ParquetReader.java ---------------------------------------------------------------------- diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/thirdparty/parquet/ParquetReader.java b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/thirdparty/parquet/ParquetReader.java new file mode 100644 index 0000000..9c167a0 --- /dev/null +++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/thirdparty/parquet/ParquetReader.java @@ -0,0 +1,146 @@ +/** + * 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.tajo.storage.thirdparty.parquet; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileStatus; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; +import parquet.filter.UnboundRecordFilter; +import parquet.hadoop.Footer; +import parquet.hadoop.ParquetFileReader; +import parquet.hadoop.api.InitContext; +import parquet.hadoop.api.ReadSupport; +import parquet.hadoop.api.ReadSupport.ReadContext; +import parquet.hadoop.metadata.BlockMetaData; +import parquet.hadoop.metadata.GlobalMetaData; +import parquet.schema.MessageType; + +import java.io.Closeable; +import java.io.IOException; +import java.util.*; + +/** + * Read records from a Parquet file. + */ +public class ParquetReader implements Closeable { + + private ReadSupport readSupport; + private UnboundRecordFilter filter; + private Configuration conf; + private ReadContext readContext; + private Iterator