草庐IT

input_text_area

全部标签

java - 如何将数组中的字符串附加到 mapreduce 中的 Text()

我有一个数组中的字符串。我需要将基于索引的数组的所有元素附加到mapreduce中的Text()。我需要将值作为字符串附加到Text()例如:Strings="12,23";String[]array=s.split(",");Textt1=newText();for(inti=0;i 最佳答案 您可以这样做而不需要拆分字符串数组:Stringstr="12,23";StringnewStr=str.replace(",","");//orreplacewithanycharacterorstringyouwantbetweenth

java - 配置单元顶点失败 : killed/failed due to:ROOT_INPUT_INIT_FAILURE Caused by: java. lang.NullPointerException

我正在查询一个表,一个简单的计数(*)并收到以下错误:Vertexfailed,vertexName=Map1,vertexId=vertex_1486982569467_0809_3_00,diagnostics=[Vertexvertex_1486982569467_0809_3_00[Map1]killed/faileddueto:ROOT_INPUT_INIT_FAILURE,VertexInput:table_nameinitializerfailed,vertex=vertex_1486982569467_0809_3_00[Map1],java.lang.RuntimeE

arrays - 配置单元 : ParseException line 3:23 cannot recognize input near 'from'

我试图创建这个表:createtabletmp_test(id_string,myelementarray>)STOREDASPARQUETLOCATION'/donne/tmp_test'我有这个错误:编译语句时出错:失败:ParseException行3:23无法识别列规范中“来自”“:”“字符串”附近的输入。我如何转义单词“from”,因为我必须使用这个词?谢谢你的帮助 最佳答案 FROM是Hive中的保留关键字。使用反引号(`)来引用它,createtabletmp_test(id_string,myelementarray

hadoop - Druid 批量索引 inputSpec 类型粒度,错误为 "no input paths specified in job"

我正在按照此处编写的说明进行操作:http://druid.io/docs/0.9.2/ingestion/batch-ingestion.html(滚动到“InputSpecspecification”,寻找“granularity”)。我的索引任务JSON中有:"inputSpec":{"type":"granularity","dataGranularity":"DAY","inputPath":"hdfs://hadoop:9000/druid/events/interview","filePattern":".*","pathFormat":"'y'=yyyy/'m'=MM/

java - Hadoop,mapreduce java.io.IOException : Type mismatch in value from map: expected org. apache.hadoop.io.Text,收到 org.apache.hadoop.io.IntWritable

我正在尝试使用两个映射器和一个缩减器。我收到以下错误:我想组合几个键,我希望得到基于每个键的求和输出。我不知道哪一部分是错的。如果您能为我的代码找到一些错误,我们将不胜感激。java.io.IOException:Typemismatchinvaluefrommap:expectedorg.apache.hadoop.io.Text,recievedorg.apache.hadoop.io.IntWritableatorg.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:896)atorg.apache

sql - 失败 : ParseException line 1:36 cannot recognize input near '1987'

我正在尝试用它在Hive中创建一个外部表CREATEEXTERNALTABLEIFNOTEXISTS1987(YEARINT,MONTHINT,DAYOFMONTHINT,DAYOFWEEKINT,DEPTIMEINT,CRSINT,ARRTIMETIME,CARRIERSTRING,FLIGHTNUMINT,TAILNUMSTRING,ACTUALELAPSEDINT,CRSELAPSEDINT,AIRTIMEINT,ARRDELAYINT,DEPDELAYINT,ORIGINSTRING,DESTSTRING,DISTANCEINT,TAXIININT,TAXIOUTINT,CAN

hadoop - ClassCastException : org. apache.hadoop.io.Text 无法在 K-Means 聚类 Mahout 中转换为 org.apache.hadoop.io.IntWritable

我正在使用Mahout命令进行K均值聚类,输入文件是“KMeansData.csv”,数据是这种格式,John,M,30,Pepsi,USJack,M,25,Coke,USDavid,M,34,Pepsi,UKTed,M,37,Limca,CANRobert,M,23,Limca,USAdrian,M,31,Pepsi,USCraig,M,37,Coke,UKKatie,F,23,Limca,UKNancy,F,32,Pepsi,UK我能够成功完成以下步骤,它们是,./mahoutseqdirectory-i/root/Mahout/Clustering/-o/root/Mahout/

java - 在 hadoop 中将 String 对象转换为 TEXT 对象

如何在不使用构造函数的情况下将字符串对象转换为hadoop中的文本对象?有可用的TexttoString方法,但我找不到StringtoText方法。 最佳答案 Texttext=newText("your-string");或Texttext=newText();text.set("your-string"); 关于java-在hadoop中将String对象转换为TEXT对象,我们在StackOverflow上找到一个类似的问题: https://stac

java - 如何在 Mapreduce 程序中遍历 Text 值的迭代器两次?

在我的MapReduce程序中,我有一个reducer函数,它计算文本值迭代器中的项目数,然后对于迭代器中的每个项目,将项目输出为键,将计数输出为值。因此我需要使用迭代器两次。但是一旦迭代器到达终点,我就无法从第一个迭代器开始迭代。我该如何解决这个问题?我为我的reduce函数尝试了以下代码:publicstaticclassReduceAextendsMapReduceBaseimplementsReducer{publicvoidreduce(Textkey,Iteratorvalues,OutputCollectoroutput,Reporterreporter)throwsIO

hadoop - Caused by : java. lang.ClassCastException : org. apache.hadoop.io.LongWritable cannot be cast to org.apache.hadoop.io.Text

我正在尝试编译以下github项目https://github.com/DigitalPebble/behemoth/tree/master/uima我收到以下错误java.lang.ClassCastException:org.apache.hadoop.io.LongWritablecannotbecasttoorg.apache.hadoop.io.Text代码定义了以下输出键和值类。其中BehemothDocument是定义的自定义类job.setInputFormat(SequenceFileInputFormat.class);job.setOutputFormat(Seq