Path inputPath = new Path(dfs.getWorkingDirectory(), "sample1-input" + System.currentTimeMillis());
simulateInput(dfs, inputPath);
// run compiler for the model
Pig8CubeIncrementalCompilerBean compiler =
new Pig8CubeIncrementalCompilerBean(
getConf(),
cubeName,
new ClassPathResource("example1-preambula.pig"),
5);
/*
* test fact compile time exclusion to allow merging different fact
* stream sources
*/
compiler.setMeasureExclude(new HashSet<String>(Arrays.asList("excludedMeasure")));
// or:
// compiler.setMeasureInclude(new
// HashSet<String>(Arrays.asList("impCnt", "click")));
/*
* this is the version that uses model from resource instead of hbl
* system table.
*/
// new Pig8CubeIncrementalCompilerBean(cubeModelRsrc, new
// ClassPathResource("example1-preambula.pig"), 5);
String script = compiler.preparePigSource(workPath.toString());
// ////////////////////////////////////
// ------------- debug: dump the script
Path dumpDir = new Path(inputPath, "__debug");
dfs.mkdirs(dumpDir);