Skip to content

Commit

Permalink
optimize fail reason
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed May 29, 2024
1 parent 5e705fd commit b0f6bf8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static RelatedTableInfo getRelatedTableInfo(String column, String timeUni
List<Object> dataTruncExpressions = dateTrunc.collectToList(DateTrunc.class::isInstance);
if (dataTruncExpressions.size() > 1) {
// mv time unit level is little then query
return new RelatedTableInfo("partition column time unit level should be"
return new RelatedTableInfo("partition column time unit level should be "
+ "greater than sql select column");
}
columnExpr = (Slot) dateTrunc.getArgument(0);
Expand Down Expand Up @@ -349,7 +349,7 @@ public Void visitLogicalJoin(LogicalJoin<? extends Plan, ? extends Plan> join,
|| joinType.isRightSemiJoin()) && !useLeft) {
return visit(join.right(), context);
}
context.addFailReason(String.format("partition track doesn't support join type, "
context.addFailReason(String.format("partition column is in un supported join null generate side, "
+ "current join type is %s", joinType));
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ public void getRelatedTableInfoSelfJoinTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("l_orderkey", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"self join doesn't support partition update"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});

Expand All @@ -415,6 +417,8 @@ public void getRelatedTableInfoSelfJoinTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("l_orderkey", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"self join doesn't support partition update"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});

Expand All @@ -429,6 +433,8 @@ public void getRelatedTableInfoSelfJoinTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("l_orderkey", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"partition column is in un supported join null generate side"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});
}
Expand Down Expand Up @@ -488,6 +494,8 @@ public void getRelatedTableInfoUseNullGenerateSideTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("o_orderdate", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"partition column is in un supported join null generate side"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});
}
Expand All @@ -506,6 +514,8 @@ public void getRelatedTableInfoTestWithoutPartitionTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("PS_SUPPLYCOST", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"self join doesn't support partition update"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});
}
Expand Down Expand Up @@ -557,6 +567,8 @@ public void getRelatedTableInfoTestWithWindowButNotPartitionTest() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("L_SHIPDATE", null,
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"window partition sets doesn't contain the target partition"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});
}
Expand Down Expand Up @@ -616,6 +628,8 @@ public void testPartitionDateTruncShouldNotTrack() {
RelatedTableInfo relatedTableInfo =
MaterializedViewUtils.getRelatedTableInfo("date_alias", "hour",
rewrittenPlan, nereidsPlanner.getCascadesContext());
Assertions.assertTrue(relatedTableInfo.getFailReason().contains(
"partition column time unit level should be greater than sql select column"));
Assertions.assertFalse(relatedTableInfo.isPctPossible());
});
}
Expand Down

0 comments on commit b0f6bf8

Please sign in to comment.