MCPcopy Create free account
hub / github.com/apache/pig / testQueryParser

Method testQueryParser

test/org/apache/pig/test/TestUTF8.java:85–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83 }
84
85 @Test
86 public void testQueryParser() throws Exception{
87 File f1 = File.createTempFile("tmp", "");
88 PrintWriter pw = new PrintWriter(f1, "UTF-8");
89 pw.println("中文");
90 pw.close();
91
92 pigServer.registerQuery("a = load '"
93 + Util.encodeEscape(Util.generateURI(f1.toString(), pigServer.getPigContext()))
94 + "' using " + PigStorage.class.getName() + "();");
95 pigServer.registerQuery("b = filter a by $0 == '中文';");
96 Iterator<Tuple> iter = pigServer.openIterator("a");
97
98 assertEquals(DataType.toString(iter.next().get(0)), "中文");
99
100 f1.delete();
101 }
102
103 @Test
104 public void testParamSubstitution() throws Exception{

Callers

nothing calls this directly

Calls 14

encodeEscapeMethod · 0.95
generateURIMethod · 0.95
toStringMethod · 0.95
openIteratorMethod · 0.80
closeMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65
createTempFileMethod · 0.45
registerQueryMethod · 0.45
toStringMethod · 0.45
getPigContextMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected