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

Method loadWithTestLoadFunc

test/org/apache/pig/test/TestCombiner.java:135–154  ·  view source on GitHub ↗
(String loadAlias, PigServer pig,
            List<String> inputLines)

Source from the content-addressed store, hash-verified

133 }
134
135 private String loadWithTestLoadFunc(String loadAlias, PigServer pig,
136 List<String> inputLines) throws IOException {
137 File inputFile = File.createTempFile("test", "txt");
138 inputFile.deleteOnExit();
139 String inputFileName = inputFile.getAbsolutePath();
140 if (pig.getPigContext().getExecType().isLocal()) {
141 PrintStream ps = new PrintStream(new FileOutputStream(inputFile));
142 for (String line : inputLines) {
143 ps.println(line);
144 }
145 ps.close();
146 } else {
147 inputFileName = Util.removeColon(inputFileName);
148 Util.createInputFile(cluster, inputFileName, inputLines.toArray(new String[] {}));
149 }
150 pig.registerQuery(loadAlias + " = load '"
151 + Util.encodeEscape(inputFileName) + "' using "
152 + PigStorage.class.getName() + "(',');");
153 return inputFileName;
154 }
155
156 @Test
157 public void testNoCombinerUse() {

Callers 1

runTestMethod · 0.95

Calls 12

removeColonMethod · 0.95
createInputFileMethod · 0.95
encodeEscapeMethod · 0.95
getAbsolutePathMethod · 0.80
toArrayMethod · 0.80
isLocalMethod · 0.65
closeMethod · 0.65
createTempFileMethod · 0.45
getExecTypeMethod · 0.45
getPigContextMethod · 0.45
registerQueryMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected