【问题标题】:SqlContext is not a member of package org.apache.spark.sqlSqlContext 不是包 org.apache.spark.sql 的成员
【发布时间】:2015-06-28 04:36:23
【问题描述】:

这是我的 build.sbt 文件:

name := "words"

version := "1.0"

scalaVersion := "2.10.4"

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "1.3.0",
  "org.apache.spark" %% "spark-sql"  % "1.3.0"
)

sbt.version=0.13.8-RC1

当我编译程序时,出现以下错误:

    [error] D:\projects\bd\words\src\main\scala\test.scala:8: 
            type SqlContext is not a member of package org.apache.spark.sql
    [error]     val sqlContext = new org.apache.spark.sql.SqlContext(sc)
    [error]                                               ^
    [error] one error found
    [error] (compile:compileIncremental) Compilation failed

【问题讨论】:

    标签: scala apache-spark sbt apache-spark-sql


    【解决方案1】:

    这是SQLContext 而不是SqlContext

    【讨论】:

      猜你喜欢
      • 2018-04-05
      • 2015-05-14
      • 2017-05-12
      • 1970-01-01
      • 2022-01-01
      • 1970-01-01
      • 2018-02-21
      • 1970-01-01
      • 2023-02-12
      相关资源
      最近更新 更多