diff --git a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/fs/FileSystem.java b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/fs/FileSystem.java index f4474e181e13db949136cf196245e794810e05fe..2c3d58008dfe8c6db81f8128594dde74ab8dab8c 100644 --- a/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/fs/FileSystem.java +++ b/nephele/nephele-common/src/main/java/eu/stratosphere/nephele/fs/FileSystem.java @@ -190,7 +190,7 @@ public abstract class FileSystem { synchronized (SYNCHRONIZATION_OBJECT) { if (uri.getScheme() == null) { - throw new IOException("FileSystem: Scheme is null"); + throw new IOException("FileSystem: Scheme is null. file:// or hdfs:// are schemes."); } final FSKey key = new FSKey(uri.getScheme(), uri.getAuthority()); diff --git a/pact/pact-common/src/main/java/eu/stratosphere/pact/common/io/DelimitedInputFormat.java b/pact/pact-common/src/main/java/eu/stratosphere/pact/common/io/DelimitedInputFormat.java index 438df6d8cd24ab79cf2a9da5c1d693269dac1cc8..116d74e71869b32c49040c024361998663807924 100644 --- a/pact/pact-common/src/main/java/eu/stratosphere/pact/common/io/DelimitedInputFormat.java +++ b/pact/pact-common/src/main/java/eu/stratosphere/pact/common/io/DelimitedInputFormat.java @@ -72,7 +72,7 @@ public abstract class DelimitedInputFormat extends FileInputFormat { */ private static int MAX_SAMPLE_LEN; - protected static final void loadGloablConfigParams() { + protected static final void loadGlobalConfigParams() { int maxSamples = GlobalConfiguration.getInteger(PactConfigConstants.DELIMITED_FORMAT_MAX_LINE_SAMPLES_KEY, PactConfigConstants.DEFAULT_DELIMITED_FORMAT_MAX_LINE_SAMPLES); int minSamples = GlobalConfiguration.getInteger(PactConfigConstants.DELIMITED_FORMAT_MIN_LINE_SAMPLES_KEY, @@ -111,7 +111,7 @@ public abstract class DelimitedInputFormat extends FileInputFormat { MAX_SAMPLE_LEN = maxLen; } - static { loadGloablConfigParams(); } + static { loadGlobalConfigParams(); } // ------------------------------------- Config Keys ------------------------------------------ diff --git a/pact/pact-compiler/src/test/java/eu/stratosphere/pact/compiler/ReduceCompilerBugTest.java b/pact/pact-compiler/src/test/java/eu/stratosphere/pact/compiler/ReduceCompilerBugTest.java new file mode 100644 index 0000000000000000000000000000000000000000..23f341f5817ee55e236d224b7c1261361634e9cc --- /dev/null +++ b/pact/pact-compiler/src/test/java/eu/stratosphere/pact/compiler/ReduceCompilerBugTest.java @@ -0,0 +1,44 @@ +package eu.stratosphere.pact.compiler; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import eu.stratosphere.pact.common.contract.FileDataSink; +import eu.stratosphere.pact.common.contract.FileDataSource; +import eu.stratosphere.pact.common.contract.ReduceContract; +import eu.stratosphere.pact.common.plan.Plan; +import eu.stratosphere.pact.compiler.plan.candidate.OptimizedPlan; +import eu.stratosphere.pact.compiler.plantranslate.NepheleJobGraphGenerator; +import eu.stratosphere.pact.compiler.util.DummyInputFormat; +import eu.stratosphere.pact.compiler.util.DummyOutputFormat; +import eu.stratosphere.pact.compiler.util.IdentityReduce; + + +/** + * This test case has been created to validate a bug that occurred when + * the ReduceContract was used without a grouping key. + */ +public class ReduceCompilerBugTest extends CompilerTestBase { + + @Test + public void testReduce() { + // construct the plan + FileDataSource source = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source"); + ReduceContract reduce1 = ReduceContract.builder(IdentityReduce.class).name("Reduce1").input(source).build(); + FileDataSink sink = new FileDataSink(DummyOutputFormat.class, OUT_FILE, "Sink"); + sink.setInput(reduce1); + Plan plan = new Plan(sink, "Test Temp Task"); + plan.setDefaultParallelism(DEFAULT_PARALLELISM); + + + try { + OptimizedPlan oPlan = compileNoStats(plan); + NepheleJobGraphGenerator jobGen = new NepheleJobGraphGenerator(); + jobGen.compileJobGraph(oPlan); + } catch(CompilerException ce) { + ce.printStackTrace(); + fail("The pact compiler is unable to compile this plan correctly"); + } + } +}