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 0346820049C for ; Fri, 11 Aug 2017 15:31:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 01A541646B1; Fri, 11 Aug 2017 13:31:14 +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 4943616145E for ; Fri, 11 Aug 2017 15:31:13 +0200 (CEST) Received: (qmail 96754 invoked by uid 500); 11 Aug 2017 13:31:12 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 96745 invoked by uid 99); 11 Aug 2017 13:31:12 -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; Fri, 11 Aug 2017 13:31:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E691FEE68A; Fri, 11 Aug 2017 13:31:10 +0000 (UTC) From: xuchuanyin To: issues@carbondata.apache.org Reply-To: issues@carbondata.apache.org References: In-Reply-To: Subject: [GitHub] carbondata pull request #1239: [CARBONDATA-1343] Hive can't query data when ... Content-Type: text/plain Message-Id: <20170811133110.E691FEE68A@git1-us-west.apache.org> Date: Fri, 11 Aug 2017 13:31:10 +0000 (UTC) archived-at: Fri, 11 Aug 2017 13:31:14 -0000 Github user xuchuanyin commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1239#discussion_r132685377 --- Diff: integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonInputFormat.java --- @@ -84,47 +92,66 @@ * @param configuration * @throws IOException */ - private static void populateCarbonTable(Configuration configuration, String paths) + private CarbonTable populateCarbonTable(Configuration configuration) throws IOException { - String dirs = configuration.get(INPUT_DIR, ""); - String[] inputPaths = StringUtils.split(dirs); - String validInputPath = null; + TableInfo tableInfo = getTableInfo(configuration); + CarbonTable carbonTable = null; + if (tableInfo != null) { + carbonTable = CarbonTable.buildFromTableInfo(tableInfo); + CarbonMetadata.getInstance().addCarbonTable(carbonTable); + return carbonTable; + } + String inputDir = configuration.get(INPUT_DIR, ""); + String[] inputPaths = StringUtils.split(inputDir); if (inputPaths.length == 0) { throw new InvalidPathException("No input paths specified in job"); - } else { - if (paths != null) { - for (String inputPath : inputPaths) { - if (paths.startsWith(inputPath)) { - validInputPath = inputPath; - break; - } - } - } } + Arrays.sort(inputPaths); + String tablePath = inputPaths[0].replace("file:", ""); --- End diff -- Is this a mistake? --- 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. ---