Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# # 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. # # NOTE that we shouldn't import pyspark here because this is used in # setup.py, and assume there's no PySpark imported.
]
""" Check the valid combinations of supported versions in Spark distributions.
Parameters ---------- spark_version : str Spark version. It should be X.X.X such as '3.0.0' or spark-3.0.0. hadoop_version : str Hadoop version. It should be X.X such as '2.7' or 'hadoop2.7'. 'without' and 'without-hadoop' are supported as special keywords for Hadoop free distribution. hive_version : str Hive version. It should be X.X such as '2.3' or 'hive2.3'.
Parameters ---------- tuple fully-qualified versions of Spark, Hadoop and Hive in a tuple. For example, spark-3.0.0, hadoop3.2 and hive2.3. """ "Spark version should start with 'spark-' prefix; however, " "got %s" % spark_version)
"Spark distribution of %s is not supported. Hadoop version should be " "one of [%s]" % (hadoop_version, ", ".join( SUPPORTED_HADOOP_VERSIONS)))
"Spark distribution of %s is not supported. Hive version should be " "one of [%s]" % (hive_version, ", ".join( SUPPORTED_HADOOP_VERSIONS)))
""" Installs Spark that corresponds to the given Hadoop version in the current library directory.
Parameters ---------- dest : str The location to download and install the Spark. spark_version : str Spark version. It should be spark-X.X.X form. hadoop_version : str Hadoop version. It should be hadoopX.X such as 'hadoop2.7' or 'without-hadoop'. hive_version : str Hive version. It should be hiveX.X such as 'hive2.3'. """
sites = [os.environ["PYSPARK_RELEASE_MIRROR"]] else:
spark_version, "Free build" if hadoop_version == "without" else hadoop_version)
# Skip the root directory. finally: raise IOError("Unable to download %s." % pretty_pkg_name)
"https://www.apache.org/dyn/closer.lua?preferred=true") except Exception: # If we can't get a mirror URL, skip it. No retry. pass
"https://archive.apache.org/dist", "https://dist.apache.org/repos/dist/release"]
bytes_so_far, total_size, round(float(bytes_so_far) / total_size * 100, 2))) |