Program: 25280
Project: 25280
Buggy source:
@Test public void testCubeWhereQueryForMonthWithNoPartialData() throws Exception {
  Configuration conf=getConf();
  conf.setBoolean(CubeQueryConfUtil.FAIL_QUERY_ON_PARTIAL_DATA,true);
  SemanticException e=getSemanticExceptionInRewrite("String_Node_Str" + "String_Node_Str" + TWO_MONTHS_RANGE_UPTO_HOURS,conf);
  Assert.assertEquals(e.getCanonicalErrorMsg().getErrorCode(),ErrorMsg.NO_CANDIDATE_FACT_AVAILABLE.getErrorCode());
  PruneCauses.BriefAndDetailedError pruneCauses=extractPruneCause(e);
  Assert.assertEquals(pruneCauses.getBrief().substring(0,CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.length() - 3),CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.substring(0,CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.length() - 3));
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.NO_CANDIDATE_STORAGES);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.NO_CANDIDATE_STORAGES);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getStorageCauses().values().iterator().next().getCause(),SkipStorageCode.PART_COL_DOES_NOT_EXIST);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getStorageCauses().values().iterator().next().getNonExistantPartCols(),Arrays.asList("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCubeWhereQueryForMonthWithNoPartialData() throws Exception {
  Configuration conf=getConf();
  conf.setBoolean(CubeQueryConfUtil.FAIL_QUERY_ON_PARTIAL_DATA,true);
  SemanticException e=getSemanticExceptionInRewrite("String_Node_Str" + "String_Node_Str" + TWO_MONTHS_RANGE_UPTO_HOURS,conf);
  Assert.assertEquals(e.getCanonicalErrorMsg().getErrorCode(),ErrorMsg.NO_CANDIDATE_FACT_AVAILABLE.getErrorCode());
  PruneCauses.BriefAndDetailedError pruneCauses=extractPruneCause(e);
  Assert.assertEquals(pruneCauses.getBrief().substring(0,CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.length() - 3),CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.substring(0,CandidateTablePruneCode.MISSING_PARTITIONS.errorFormat.length() - 3));
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.NO_FACT_UPDATE_PERIODS_FOR_GIVEN_RANGE);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.NO_CANDIDATE_STORAGES);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.MISSING_PARTITIONS);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getCause(),CandidateTablePruneCode.NO_CANDIDATE_STORAGES);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getStorageCauses().values().iterator().next().getCause(),SkipStorageCode.PART_COL_DOES_NOT_EXIST);
  Assert.assertEquals(pruneCauses.getDetails().get("String_Node_Str").iterator().next().getStorageCauses().values().iterator().next().getNonExistantPartCols(),Arrays.asList("String_Node_Str"));
}