From reviews-return-598855-archive-asf-public=cust-asf.ponee.io@spark.apache.org Thu Jan 4 06:16:25 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 09CA118077A for ; Thu, 4 Jan 2018 06:16:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EDB5F160C39; Thu, 4 Jan 2018 05:16:24 +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 66C5C160C1B for ; Thu, 4 Jan 2018 06:16:24 +0100 (CET) Received: (qmail 38141 invoked by uid 500); 4 Jan 2018 05:16:23 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 38130 invoked by uid 99); 4 Jan 2018 05:16:23 -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, 04 Jan 2018 05:16:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D973DFDF4; Thu, 4 Jan 2018 05:16:23 +0000 (UTC) From: cloud-fan To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #20147: [SPARK-22940][SQL] HiveExternalCatalogVersionsSui... Content-Type: text/plain Message-Id: <20180104051623.2D973DFDF4@git1-us-west.apache.org> Date: Thu, 4 Jan 2018 05:16:23 +0000 (UTC) Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/20147#discussion_r159582192 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala --- @@ -85,6 +90,43 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { new File(tmpDataDir, name).getCanonicalPath } + private def getFileFromUrl(urlString: String, targetDir: String, filename: String): Boolean = { + val conf = new SparkConf + val securityManager = new SecurityManager(conf) + val hadoopConf = new Configuration + + val outDir = new File(targetDir) + if (!outDir.exists()) { + outDir.mkdirs() + } + + try { + val result = Utils.doFetchFile(urlString, outDir, filename, conf, securityManager, hadoopConf) --- End diff -- `Utils.doFetchFile` is a little overkill for this case, maybe we can just implement a simple downloading function with java. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org