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

Method checkDuplicateStoreLoc

src/org/apache/pig/PigServer.java:1912–1920  ·  view source on GitHub ↗

This method checks whether the multiple sinks (STORE) use the same "file-based" location. If yes, throws a RuntimeException @param storeOps

(Set<LOStore> storeOps)

Source from the content-addressed store, hash-verified

1910 * @param storeOps
1911 */
1912 private void checkDuplicateStoreLoc(Set<LOStore> storeOps) {
1913 Set<String> uniqueStoreLoc = new HashSet<String>();
1914 for(LOStore store : storeOps) {
1915 String fileName = store.getFileSpec().getFileName();
1916 if(!uniqueStoreLoc.add(fileName) && UriUtil.isHDFSFileOrLocalOrS3N(fileName, new Configuration(true))) {
1917 throw new RuntimeException("Script contains 2 or more STORE statements writing to same location : "+ fileName);
1918 }
1919 }
1920 }
1921
1922 protected Graph duplicate() {
1923 // There are two choices on how we duplicate the logical plan

Callers 1

postProcessMethod · 0.95

Calls 4

addMethod · 0.65
getFileNameMethod · 0.45
getFileSpecMethod · 0.45

Tested by

no test coverage detected