草庐IT

INPUT_FILE

全部标签

java - spring-xd如何使用source :file read line one by one

我有一个流,用于监视目录中多个文件的输出、处理数据并将其放入HDFS。这是我的流创建命令:streamcreate--namefileHdfs--definition"file--dir=/var/log/supervisor/--pattern=tracker.out-*.log--outputType=text/plain|logHdfsTransformer|hdfs--fsUri=hdfs://192.168.1.115:8020--directory=/data/log/appsync--fileName=log--partitionPath=path(dateFormat(

hadoop - 失败 : ParseException: cannot recognize input near 'exchange' 'string' ',' in column specification

我正在使用最新的AWSHive版本0.13.0.FAILED:ParseException:cannotrecognizeinputnear'exchange''string'','incolumnspecification当我运行以下(创建表)查询时出现上述错误。CREATEEXTERNALTABLEtest(foostring,exchangestring,barstring)ROWFORMATDELIMITEDFIELDSTERMINATEDBY'\t'LINESTERMINATEDBY'\n'STOREDASTEXTFILELOCATION'/home/hadoop/test/

java - mapreduce.reduce.shuffle.memory.limit.percent、mapreduce.reduce.shuffle.input.buffer.percent 和 mapreduce.reduce.shuffle.merge.percent

我只是想验证我对这些参数及其关系的理解,如果我错了请通知我。mapreduce.reduce.shuffle.input.buffer.percent告诉分配给reducer的整个洗牌阶段的内存总量。mapreduce.reduce.shuffle.memory.limit.percent告诉单个shuffle可以从mapreduce.reduce.shuffle.input消耗的内存限制的最大百分比.buffer.percent.mapreduce.reduce.shuffle.merge.percent是启动内存中合并的使用阈值,表示为总内存的百分比(mapreduce.reduc

java - 链接两个作业时 hadoop.mapreduce.lib.input.FileInputFormat.getBlockIndex 中的 NullPointerException

我正在尝试构建倒排索引。我链接了两个作业。基本上,第一个作业解析输入并对其进行清理,并将结果存储在文件夹“output”中,该文件夹是第二个作业的输入文件夹。第二个工作应该实际构建倒排索引。当我刚找到第一份工作时,它工作得很好(至少,没有异常(exception))。我像这样链接两个作业:publicclassMain{publicstaticvoidmain(String[]args)throwsException{StringinputPath=args[0];StringoutputPath=args[1];StringstopWordsPath=args[2];Stringfi

hadoop - 奥齐 : file and archive tag usage and differences?

在oozie模式中,java操作有两个标记,File和Archive。我想了解它们的用法?我还注意到这两个标签也应用于MR/pig操作。 最佳答案 关于文件和存档标签的快速描述:Thefile&archiveelementsmakeavailable,tomap-reducejobs,filesandarchives.Ifthespecifiedpathisrelative,itisassumedthefileorarchiverarewithintheapplicationdirectory,inthecorrespondings

json - 配置单元 : How to explode a JSON column embedded in a CSV file?

从一个CSV文件(带有一个标题和一个竖线分隔符)我得到了以下两个包含一个JSON列(里面有一个集合)的内容,如下所示:第一种情况(使用没有名称的JSON集合):ProductId|IngestTime|ProductOrders9180|20171025145034|[{"OrderId":"299","Location":"NY"},{"OrderId":"499","Location":"LA"}]8251|20171026114034|[{"OrderId":"1799","Location":"London"}]第二种情况(带有一个名为“Orders”的JSON集合):Prod

file - Map在Hadoop下运行时应该把临时文件放在哪里

我在SLES10(SUSE)下运行Hadoop0.20.1。我的maptask获取一个文件并生成更多文件,然后我从这些文件生成我的结果。我想知道我应该把这些文件放在哪里,这样性能才会好并且没有冲突。如果Hadoop可以自动删除该目录,那就太好了。现在,我正在使用临时文件夹和任务ID创建一个唯一的文件夹,然后在该文件夹的子文件夹中工作。reduceTaskId=job.get("mapred.task.id");reduceTempDir=job.get("mapred.temp.dir");StringmyTemporaryFoldername=reduceTempDir+File.s

Python 代码有效,但 Hadoop Streaming 生成 part-00000 "Empty file"

在Ubuntu虚拟机上,我根据MichaelNoll的tutorial设置了一个单节点集群这是我编写Hadoop程序的起点。另外,作为引用,this.我的程序使用Python并使用HadoopStreaming。我写了一个简单的向量乘法程序,其中mapper.py接受输入文件v1和v2,每个文件都包含一个向量12,33,10并返回产品。然后reducer.py返回乘积之和,即:映射器:map(mult,v1,v2)reducer:sum(p1,p2,p3,...,pn)映射器.py:importsysdefmult(x,y):returnint(x)*int(y)#Inputcomes

hadoop - 配置单元 : How to execute a query from a file and dump the output in hdfs

我可以从sql文件执行查询并将输出存储在本地文件中使用hive-f/home/Prashasti/test.sql>/home/Prashasti/output.csv此外,我可以使用以下方法将配置单元查询的输出存储在hdfs中:insertoverwritedirectory'user/output'select*fromfolders;有什么方法可以从sql文件运行查询并将输出也存储在hdfs中吗? 最佳答案 只需要修改sql文件,将insertoverwritedirectory'user/output'添加到查询的前面。

hadoop - java.io.IOException : Not a data file 异常

我正在处理一堆存储在HDFS嵌套目录结构中的avro文件。这些文件存储在年/月/日/小时格式的目录结构中。我写了这个简单的代码来处理sc.hadoopConfiguration.set("mapreduce.input.fileinputformat.input.dir.recursive","true")valrootDir="/user/cloudera/rootDir"valrdd1=sc.newAPIHadoopFile[AvroKey[GenericRecord],NullWritable,AvroKeyInputFormat[GenericRecord]](rootDir)