草庐IT

scala-lang

全部标签

java.lang.NoClassDefFoundError : TestProtos/AuthMethodResponseProto 错误

我正在尝试使用Maven从github构建Hadoop公共(public)项目(truk)。但是构建失败并抛出以下错误,[ERROR]Failedtoexecutegoalorg.apache.maven.plugins:maven-surefire-plugin:2.17:test(default-test)onprojecthadoop-common:Executiondefault-testofgoalorg.apache.maven.plugins:maven-surefire-plugin:2.17:testfailed:java.lang.NoClassDefFoundEr

scala - 从终端在 Spark scala 中添加外部库

我正在尝试为spark添加外部库,因为我已尝试将这些库放在/usr/lib/spark/lib中。当我成功添加库后运行我的代码时出现错误:未找到。我不知道还有什么地方可以放置jar文件,我使用的是CDH5.7.0 最佳答案 我在深入挖掘后找到了解决方案,我通过在从终端打开sparkshell的同时添加jar解决了这个问题。我使用了下面的代码:spark-shell--jars"dddd-xxx-2.2.jar,xxx-examples-2.2.jar" 关于scala-从终端在Spark

java.lang.NoSuchMethodError : org. apache.hadoop.tracing.TraceUtils.wrapHadoopConf 错误

我正在尝试执行此中可用的MapReduce单元测试link我正在运行BasicMRTest.java我的POM.xml是4.0.0cooltooltool1.0.0-SNAPSHOTclouderahttps://repository.cloudera.com/artifactory/cloudera-repos/org.apache.hadoophadoop-mapreduce-client-core2.7.2jarprovidedorg.apache.hadoophadoop-common2.7.2org.apache.hadoophadoop-test2.6.0-mr1-cdh5

scala - 使用 SqlContext 连接 Hive 表

我的问题对你们大多数人来说可能听起来很愚蠢,但我需要使用spark-scala在我的配置单元表中执行一些操作,为此我想知道我是否可以使用SqlContext来读取hive表。我知道HiveContext但我想使用SqlContext。 最佳答案 正如评论中提到的@BinaryNerd:HiveContextextendsSQLContext所以当你使用类型安全的语言(Java)时,你可以这样声明你的SQLContext:SQLContextsqlContext=newHiveContext(sc)

scala - Spark - 另一个转换中的 Rdd 转换

我试图在另一个转换中转换RDD。因为,RDD转换和操作只能由驱动程序调用,我收集了第二个RDD并尝试在其他转换中对其应用转换,如下所示valname_match=first_names.map(y=>(y,first_names_collection.value.filter(z=>soundex.difference(z,y)==4)))上面的代码抛出了下面的异常org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException):App

scala - Mapreduce 使用 Scala 错误 : java. lang.ClassNotFoundException : scala. Predef$

我尝试通过scala实现一个简单的mapreduce作业。但是,当我使用命令运行包时,hadoopjarhadoop.jarmapreduce.MaxTemperaturehdfs://sandbox/user/ajay/inputhdfs://sandbox/user/ajay/output我得到错误,16/09/0616:06:12INFOmapreduce.Job:TaskId:attempt_1473177830264_0002_m_000001_2,Status:FAILEDError:java.lang.ClassNotFoundException:scala.Predef

已解决java.lang.NumberFormatException异常的正确解决方法,亲测有效!!!

已解决java.lang.NumberFormatException异常的正确解决方法,亲测有效!!!文章目录问题分析报错原因解决方法总结在日常软件开发过程中,Java开发人员经常会遇到各种异常。java.lang.NumberFormatException是其中相对常见的一个,它通常会在处理数字转换任务时出现。这篇博客将详细讲解NumberFormatException的产生场景、原因和解决方法。 问题分析java.lang.NumberFormatException是Java在执行字符串到数字的转换时,如果转换的字符串不是适当格式,则抛出的异常。常见的场景包括:用户输入数据处理文件和数据库

scala - spark-submit 无法访问本地文件系统

第一个count()方法调用中的非常简单的Scala代码文件。defmain(args:Array[String]){//createSparkcontextwithSparkconfigurationvalsc=newSparkContext(newSparkConf().setAppName("SparkFileCount"))valfileList=recursiveListFiles(newFile("C:/data")).filter(_.isFile).map(file=>file.getName())valfilesRDD=sc.parallelize(fileList)

scala - 通过 Scala IDE 使用 spark sql

我想试试sparksql,我一开始用的是bin/spark-shell插入此代码valsqlcontext=neworg.apache.spark.sql.SQLContext(sc)valdata=sc.textFile("hdfs://localhost:9000/cars.csv")valmapr=data.map(p=>p.split(','))valMyMatchRDD=mapr.map(p=>MyMatch(p(0).toString(),p(1).toString(),p(2).toString(),p(3).toString(),p(4).toString(),p(5)

scala - 列出文件 scala emr hdfs(缺少 csv 文件)

我试图通过以下方法列出emrhdfs上目录中的所有文件:valdirectory=newFile(directoryPath)valfileStatusListIterator:RemoteIterator[LocatedFileStatus]=FileUtils.fs.listFiles(newPath(directoryPath),true)while(fileStatusListIterator.hasNext){valfileStatus=fileStatusListIterator.nextif(fileStatus.isFile){log.info(s"IteratorFi