Return-Path: X-Original-To: apmail-spark-reviews-archive@minotaur.apache.org Delivered-To: apmail-spark-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DFCBA10C22 for ; Fri, 23 May 2014 07:35:08 +0000 (UTC) Received: (qmail 79323 invoked by uid 500); 23 May 2014 07:35:08 -0000 Delivered-To: apmail-spark-reviews-archive@spark.apache.org Received: (qmail 79298 invoked by uid 500); 23 May 2014 07:35:08 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@spark.apache.org Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 79290 invoked by uid 99); 23 May 2014 07:35:08 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2014 07:35:08 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 47CF799FA38; Fri, 23 May 2014 07:35:08 +0000 (UTC) From: andrewor14 To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request: [SPARK-1900] Fix running PySpark files on YARN Content-Type: text/plain Message-Id: <20140523073508.47CF799FA38@tyr.zones.apache.org> Date: Fri, 23 May 2014 07:35:08 +0000 (UTC) Github user andrewor14 commented on a diff in the pull request: https://github.com/apache/spark/pull/853#discussion_r12988570 --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala --- @@ -1166,4 +1166,35 @@ private[spark] object Utils extends Logging { true } } + + /** Return the URI of the input path. If a relative path is given, assume it is local. */ + def resolveURI(path: String, testWindows: Boolean = false): URI = { + + // On Windows, file names cannot contain backslashes and colons, + // and each drive contains only a single alphabet character + val windows = isWindows || testWindows + val sanitizedPath = if (windows) path.replace("\\", "/") else path + val windowsDrive = "([a-zA-Z])".r + + val uri = new URI(sanitizedPath) + uri.getScheme match { + case windowsDrive(d) if windows => + new URI("file:/" + uri.toString.stripPrefix("/")) + case null => + val fragment = uri.getFragment --- End diff -- There is a small bullet point that explains this: http://people.apache.org/~pwendell/spark-1.0.0-rc7-docs/running-on-yarn.html#important-notes I'll add a comment here. --- 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. ---