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 F1289200C07 for ; Sun, 8 Jan 2017 00:58:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EFD07160B4A; Sat, 7 Jan 2017 23:58:59 +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 45A7D160B3C for ; Sun, 8 Jan 2017 00:58:59 +0100 (CET) Received: (qmail 34390 invoked by uid 500); 7 Jan 2017 23:58:58 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 34379 invoked by uid 99); 7 Jan 2017 23:58:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2017 23:58:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 53A782C022B for ; Sat, 7 Jan 2017 23:58:58 +0000 (UTC) Date: Sat, 7 Jan 2017 23:58:58 +0000 (UTC) From: "Xiao Li (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-19120) Returned an Empty Result after Loading a Hive Table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 07 Jan 2017 23:59:00 -0000 [ https://issues.apache.org/jira/browse/SPARK-19120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Li updated SPARK-19120: ---------------------------- Description: {noformat} sql( """ |CREATE TABLE test (a STRING) |STORED AS PARQUET """.stripMargin) spark.table("test").show() sql( s""" |LOAD DATA LOCAL INPATH '$newPartitionDir' OVERWRITE |INTO TABLE test """.stripMargin) spark.table("test").show() {noformat} The returned result is empty after table loading. We should refresh the metadata cache after loading the data to the table. was: {noformat} sql( """ |CREATE TABLE test_added_partitions (a STRING) |PARTITIONED BY (b INT) |STORED AS PARQUET """.stripMargin) // Create partition without data files and check whether it can be read sql(s"ALTER TABLE test_added_partitions ADD PARTITION (b='1')") spark.table("test_added_partitions").show() sql( s""" |LOAD DATA LOCAL INPATH '$newPartitionDir' OVERWRITE |INTO TABLE test_added_partitions PARTITION(b='1') """.stripMargin) spark.table("test_added_partitions").show() {noformat} The returned result is empty after table loading. We should refresh the metadata cache after loading the data to the table. This only happens if users manually add the partition by {{ALTER TABLE ADD PARTITION}} > Returned an Empty Result after Loading a Hive Table > --------------------------------------------------- > > Key: SPARK-19120 > URL: https://issues.apache.org/jira/browse/SPARK-19120 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 2.1.0 > Reporter: Xiao Li > Assignee: Xiao Li > Priority: Critical > Labels: correctness > > {noformat} > sql( > """ > |CREATE TABLE test (a STRING) > |STORED AS PARQUET > """.stripMargin) > spark.table("test").show() > sql( > s""" > |LOAD DATA LOCAL INPATH '$newPartitionDir' OVERWRITE > |INTO TABLE test > """.stripMargin) > spark.table("test").show() > {noformat} > The returned result is empty after table loading. We should refresh the metadata cache after loading the data to the table. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org