本文整理汇总了Java中org.apache.pig.builtin.Utf8StorageConverter类的典型用法代码示例。如果您正苦于以下问题:Java Utf8StorageConverter类的具体用法?Java Utf8StorageConverter怎么用?Java Utf8StorageConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Utf8StorageConverter类属于org.apache.pig.builtin包,在下文中一共展示了Utf8StorageConverter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSortedBag
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
private DataBag getSortedBag(String bagString, String schema) throws Exception {
Utf8StorageConverter converter = new Utf8StorageConverter();
ResourceFieldSchema parsedSchema = new ResourceFieldSchema(Utils.parseSchema("the_bag: " + schema).getField("the_bag"));
DataBag bag = converter.bytesToBag(bagString.getBytes("UTF-8"), parsedSchema);
return getSortedBag(bag);
}
开发者ID:apache,项目名称:incubator-datafu,代码行数:7,代码来源:BagTests.java
示例2: getLoadCaster
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Override
public LoadCaster getLoadCaster() throws IOException {
return new Utf8StorageConverter();
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:5,代码来源:DumpStreamerBad.java
示例3: getLoadCaster
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Override
public LoadCaster getLoadCaster() throws IOException {
return new Utf8StorageConverter();
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:5,代码来源:DumpStreamer.java
示例4: testBooleanToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testBooleanToBytes() throws IOException {
assertTrue(DataType.equalByteArrays(Boolean.TRUE.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(Boolean.TRUE)));
assertTrue(DataType.equalByteArrays(Boolean.FALSE.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(Boolean.FALSE)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例5: testIntegerToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testIntegerToBytes() throws IOException {
Integer i = r.nextInt();
assertTrue(DataType.equalByteArrays(i.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(i)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例6: testLongToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testLongToBytes() throws IOException {
Long l = r.nextLong();
assertTrue(DataType.equalByteArrays(l.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(l)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例7: testFloatToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testFloatToBytes() throws IOException {
Float f = r.nextFloat();
assertTrue(DataType.equalByteArrays(f.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(f)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例8: testDoubleToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testDoubleToBytes() throws IOException {
Double d = r.nextDouble();
assertTrue(DataType.equalByteArrays(d.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(d)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例9: testDateTimeToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testDateTimeToBytes() throws IOException {
DateTime dt = new DateTime(r.nextLong());
assertTrue(DataType.equalByteArrays(dt.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(dt)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例10: testCharArrayToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testCharArrayToBytes() throws IOException {
String s = GenRandomData.genRandString(r);
assertTrue(s.equals(new String(((Utf8StorageConverter)ps.getLoadCaster()).toBytes(s))));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例11: testTupleToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testTupleToBytes() throws IOException {
Tuple t = GenRandomData.genRandSmallBagTextTuple(r, 1, 100);
assertTrue(DataType.equalByteArrays(t.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(t)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例12: testBagToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testBagToBytes() throws IOException {
DataBag b = GenRandomData.genRandFullTupTextDataBag(r,5,100);
assertTrue(DataType.equalByteArrays(b.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(b)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例13: testMapToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testMapToBytes() throws IOException {
Map<String, Object> m = GenRandomData.genRandMap(r,5);
assertTrue(DataType.equalByteArrays(DataType.mapToString(m).getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(m)));
}
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:6,代码来源:TestConversions.java
示例14: testTupleToBytes
import org.apache.pig.builtin.Utf8StorageConverter; //导入依赖的package包/类
@Test
public void testTupleToBytes() throws IOException {
Tuple t = GenRandomData.genRandSmallBagTextTuple(r, 1, 100);
//Tuple t = GenRandomData.genRandSmallTuple(r, 100);
assertTrue(DataType.equalByteArrays(t.toString().getBytes(), ((Utf8StorageConverter)ps.getLoadCaster()).toBytes(t)));
}
开发者ID:PonIC,项目名称:PonIC,代码行数:7,代码来源:TestConversions.java
注:本文中的org.apache.pig.builtin.Utf8StorageConverter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论