jupyter notebook pyspark 사용 (mac)

dddwsd·2022년 3월 20일
0
  1. spark download
brew install apache-spark

설치후에 버전확인.

dddwsd@Adminui-MacBookPro-7:~$ pyspark --version

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.1/libexec/jars/spark-unsafe_2.12-3.2.1.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
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 3.2.1
      /_/

Using Scala version 2.12.15, OpenJDK 64-Bit Server VM, 11.0.14.1
Branch HEAD
Compiled by user hgao on 2022-01-20T19:26:14Z
Revision 4f25b3f71238a00508a356591553f2dfa89f8290
Url https://github.com/apache/spark
Type --help for more information.
  1. pyspark 실행시 jupyter로 접속하도록 환경변수 설정
export PYSPARK_DRIVER_PYTHON=jupyter
export PYSPARK_DRIVER_PYTHON_OPTS='notebook'

이 후 pyspark 입력했을때 jupyter notebook 켜지면 성공

  1. pyspark 테스트
    노트파일 생성하고 pyspark 버전확인
profile
Github - https://github.com/dddwsd

0개의 댓글