Preparo apache-spark instalado a través de homebrew
brew install apache-sparkLuego corrió
Spark-shellY devolvió las siguientes advertencias:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.spark.unsafe.Platform (file:/usr/local/Cellar/apache-spark/3.2.0/libexec/jars/spark-unsafe_2.12-3.2.0.jar) to constructor java.nio.DirectByteBuffer(long,int) WARNING: Please consider reporting this to the maintainers of org.apache.spark.unsafe.Platform WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). 22/01/10 18:21:03 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Spark context Web UI available at http://ip-192-168-1-176.ec2.internal:4040 Spark context available as 'sc' (master = local[*], app id = local-1641860464071). Spark session available as 'spark'. Welcome to ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /___/ .__/\_,_/_/ /_/\_\ version 3.2.0 /_/ Using Scala version 2.12.15 (OpenJDK 64-Bit Server VM, Java 11.0.12) Type in expressions to have them evaluated. Type :help for more information.Aquí está mi java --versión
openjdk 11.0.12 2021-07-20 OpenJDK Runtime Environment Homebrew (build 11.0.12+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)¿Cómo resuelvo las advertencias?
Hay dos problemas que deben abordarse para deshacerse de estos errores:
Java11 y Spark 3.2 cuando se usan juntos producen estos errores. El primer paso es cambiar a Java8 hasta que se resuelva este problema.
Obtengo los mismos errores al usar brew que tú, incluso si estoy usando Java8. En lugar de usar brew, vaya al sitio web de Apache en https://www.apache.org/dyn/closer.lua/spark/spark-3.2.0/spark-3.2.0-bin-hadoop3.2.tgz y descomprima Este archivo. Para configurar su variable PATH para que pueda escribir "spark-shell", deberá ingresar a su .bash, .profile o .zshrc (el que use) y agregar "export SPARK_HOME=path-to-spark- carpeta" y luego agregue $ SPARK_HOME a su variable PATH.