草庐IT

best_fields

全部标签

hadoop - Giraph best 的顶点输入格式,用于 ID 类型为 String 的输入文件

我的PC上有一个正常工作的多节点giraph集群。我从Giraph执行了SimpleShortestPathExample并且执行得很好。此算法使用此文件(tiny_graph.txt)运行:[0,0,[[1,1],[3,3]]][1,0,[[0,1],[2,2],[3,1]]][2,0,[[1,2],[4,4]]][3,0,[[0,3],[1,1],[4,4]]][4,0,[[3,4],[2,4]]]此文件具有以下输入格式:[source_id,source_value,[[dest_id,edge_value],...]]现在,我尝试在同一个集群中执行同一个算法,但输入文件与原始文

hadoop - Apache pig : Easier way to filter by a bunch of values from the same field

假设我想根据同一字段中的值选择数据子集。现在我必须做这样的事情TestLocationsResults=FILTERSalesDataby(StoreId=='17'orStoreId=='85'orStoreId=='12'orStoreId=='45'orStoreId=='26'orStoreId=='75'orStoreId=='13')在SQL中,我们可以简单地这样做:SELECT*FROMSalesDatawhereStoreIDIN(17,12,85,45,26,75,13)Pig中是否有我缺少的类似快捷方式? 最佳答案

hadoop - Cloudera错误-java.lang.NoSuchFieldError : IS_SECURITY_ENABLED while trying to access this field

DoneMyHome工作到处搜索,但没有找到任何解决方案java.lang.NoSuchFieldError:IS_SECURITY_ENABLEDCDH包包含冲突的jar(jsp-api-2.1-6.1.14.jar、jasper-runtime-5.5.23.jar)。jsp-api-2.1-6.1.14.jar和jasper-runtime-5.5.23.jar包含不同版本的org.apache.Constants.java类。jasper-runtime-*jar不包含字段“IS_SECURITY_ENABLED”,因此jetty在尝试访问类org.apache.Constan

hadoop - PIG 存储函数 : storing only certain fields is possible?

我有一个用例,我只需要将某些字段存储到HDFS。我知道我可以做一些foreach等等来保留感兴趣的领域,但我想知道这在Store函数中是否可行。 最佳答案 这可以使用您自定义的Store函数:http://ofps.oreilly.com/titles/9781449302641/load_and_store_funcs.html但一般来说,使用GENERATE并将所需字段存储在一些其他元组中要容易得多,这些元组将仅在STORE函数中使用 关于hadoop-PIG存储函数:storing

Scala 和 Hive : best way to write a generic method that works with all types of Writable

我正在玩在Scala中为Hive编写通用UDF。我的第一个测试是编写一个函数来对数组(复杂数据类型)求和。我的代码stub如下所示(因为这是stub,请忽略asInstanceOf的用法:D):...classSumElementsextendsGenericUDF{protectedvalexpectedCategories:Array[Category]=Array(ObjectInspector.Category.LIST)protectedvarlistInspector:ListObjectInspector=_@throws(classOf[UDFNullArgumentE

hadoop - Apache hive : How to use Unicode character (with octal above 177) as field delim

在我们的用例中,我们将获取格式如下的UTF-8文本数据:Data1§Data2Data3§Data4现在我们希望在ApacheHive中将Data1和Data3放在一列中,将Data2和Data4放在一列中。听起来很简单。但是,我们无法将§字符(即unicodeU+00A7“SectionSign”参见here)指定为字段分隔符。我们已经尝试了以下方法,都没有达到可接受的结果。1)使用方法终止的普通字段ROWFORMATDELIMITEDFIELDSTERMINATEDBY'§'返回(注意附加到每个单元格的?,在其他客户端中,unicode符号表示无法识别的符号)+----------

java - 读取 Avro 文件给出 AvroTypeException : missing required field error (even though the new field is declared null in schema)

我正在尝试反序列化/读取Avro文件,avro数据文件没有新字段。即使新字段在模式中声明为null,它也应该是可选的。但它仍然给我错误作为强制性的。Exceptioninthread"main"org.apache.avro.AvroTypeException:Foundcom.kiran.avro.User,expectingcom.kiran.avro.User,missingrequiredfieldlocAVRO模式声明:{"name":"loc","type":["string","null"]}使用代码读取文件:DatumReaderuserDatumReader=newS

hadoop - pig : Pulling individual fields out after a GROUP

在PigLatin中,我想从要选择的记录中提取其他字段,因为有聚合,例如MAX。我无法解释这个问题,所以这里有一个例子。假设我想获取家中最年长者的姓名:关系A是四列,(name,address,zipcode,age)B=GROUPABY(address,zipcode);#groupbytheaddress#generatetheaddress,theperson'sage,buthowdoIgrabthatperson'sname?C=FOREACHBGENERATEFLATTEN(group),MAX(age),???Name???;如何生成年龄为MAX的人的姓名?

hadoop - pig : Invalid field Projection; Projected Field does not exist

describefilter_records;这给了我以下格式:filter_records:{details1:(firstname:chararray,lastname:chararray,age:int,gender:chararray),details2:(firstname:chararray,lastname:chararray,age:int,gender:chararray)}我想显示details1和details2中的firstname。我试过这个:display_records=FOREACHfilter_recordsGENERATEdisplay1.first

hadoop - 如何更改现有 Hive 表的 FIELD TERMINATED 值?

我目前有一个表t1,它在我的FIELDTERMINATED子句中设置了一个值'\t'。现在我想更改Tablet1结构中的那个特定子句。有什么方法可以在创建后ALTERFIELDTERMINATED子句吗? 最佳答案 hive>ALTERTABLEtable_namesetserde'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'WITHSERDEPROPERTIES('field.delim'='|');它有效。在应用查询之前和之后检查DESCFORMATTEDtbl_name