Tôi gặp sự cố khi nhập magellan-1.0.4-s_2.11
vào sổ ghi chép tia lửa. Tôi đã tải xuống bình từ https://spark-packages.org/package/harsha2010/magellan và đã thử đặt SPARK_HOME/bin/spark-shell --packages harsha2010:magellan:1.0.4-s_2.11
trong phần Start of Customized Settings
của tệp spark-notebook của thư mục bin.Cách nhập thư viện trong Máy tính xách tay Spark
Dưới đây là hàng nhập khẩu của tôi
import magellan.{Point, Polygon, PolyLine}
import magellan.coord.NAD83
import org.apache.spark.sql.magellan.MagellanContext
import org.apache.spark.sql.magellan.dsl.expressions._
import org.apache.spark.sql.Row
import org.apache.spark.sql.types._
Và lỗi của tôi ...
<console>:71: error: object Point is not a member of package org.apache.spark.sql.magellan
import magellan.{Point, Polygon, PolyLine}
^
<console>:72: error: object coord is not a member of package org.apache.spark.sql.magellan
import magellan.coord.NAD83
^
<console>:73: error: object MagellanContext is not a member of package org.apache.spark.sql.magellan
import org.apache.spark.sql.magellan.MagellanContext
sau đó tôi đã cố gắng để nhập khẩu các thư viện mới như bất kỳ thư viện khác bằng cách đặt nó vào main script
như vậy:
$lib_dir/magellan-1.0.4-s_2.11.jar"
Điều này không hiệu quả và tôi đang gãi đầu tự hỏi điều tôi đã không e sai. Làm thế nào để nhập các thư viện như magellan vào máy tính xách tay spark?