Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 77D57200CD9 for ; Thu, 3 Aug 2017 21:22:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7644616C502; Thu, 3 Aug 2017 19:22:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BB18416C4FC for ; Thu, 3 Aug 2017 21:22:55 +0200 (CEST) Received: (qmail 41205 invoked by uid 500); 3 Aug 2017 19:22:54 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 41189 invoked by uid 99); 3 Aug 2017 19:22:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2017 19:22:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 57821E112D; Thu, 3 Aug 2017 19:22:54 +0000 (UTC) From: vdiravka To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #877: DRILL-5660: Drill 1.10 queries fail due to Parquet ... Content-Type: text/plain Message-Id: <20170803192254.57821E112D@git1-us-west.apache.org> Date: Thu, 3 Aug 2017 19:22:54 +0000 (UTC) archived-at: Thu, 03 Aug 2017 19:22:56 -0000 Github user vdiravka commented on a diff in the pull request: https://github.com/apache/drill/pull/877#discussion_r131164453 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/MetadataVersions.java --- @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.drill.exec.store.parquet; + +import com.google.common.collect.ImmutableSortedSet; +import org.apache.drill.common.exceptions.DrillRuntimeException; + +import java.util.NavigableSet; + +/** + * Supported metadata versions. + *

+ * String metadata version consists of the following characters:
+ * optional "v" letter,
+ * major metadata version (any number of digits),
+ * optional "." delimiter (used if minor metadata version is specified),
+ * minor metadata version (one digit number) + *

+ * Note: keep them synchronized with {@link Metadata.ParquetTableMetadataBase} versions + */ +public class MetadataVersions { + /** + * Version 1: Introduces parquet file metadata caching.
+ * See DRILL-2743 + */ + public static final String V1 = "v1"; + /** + * Version 2: Metadata cache file size is reduced.
+ * See DRILL-4053 + */ + public static final String V2 = "v2"; + /** + * Version 3: Difference between v3 and v2 : min/max, type_length, precision, scale, repetitionLevel, definitionLevel.
+ * Filter pushdown for Parquet is implemented.
+ * See DRILL-1950 + */ + public static final String V3 = "v3"; + /** + * Version 3.1: Absolute paths of files and directories are replaced with relative ones. Metadata version value + * doesn't contain `v` letter
+ * See DRILL-3867, DRILL-5660 + */ + public static final String V3_1 = "3.1"; + + /** + * Helper method to parse string metadata version into float. + * + * @param stringVersion text metadata version + * @return parsed Float metadata version + */ + public static Float parseStringMetadataVersion(String stringVersion) { + try { + if (stringVersion.contains(".") && stringVersion.split("\\.")[1].length() != 1) { + throw new DrillRuntimeException("Minor metadata version shouldn't be greater than 9 or contain more than one digit"); + } + return stringVersion.charAt(0) == 'v' ? Float.valueOf(stringVersion.substring(1)) : Float.valueOf(stringVersion); + } catch (Exception e) { + throw new DrillRuntimeException(String.format("Could not parse metadata version '%s'", stringVersion), e); + } + } + + /** + * All historical versions of the Drill metadata cache files + */ + public static final NavigableSet SUPPORTED_VERSIONS = ImmutableSortedSet.of( --- End diff -- Done --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---