Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/489#discussion_r62089298
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/TestFunctionsWithTypeExpoQueries.java
---
@@ -719,4 +727,73 @@ public void testWindowSumConstant() throws Exception {
final String[] excludedPlan = {};
PlanTestBase.testPlanMatchingPatterns(query, expectedPlan,
excludedPlan);
}
+
+ @Test // DRILL-4552
+ public void testDecimalPlusWhenDecimalEnabled() throws Exception {
+ final String query = "select cast('99' as decimal(9,0)) + cast('99' as
decimal(9,0)) as col \n" +
+ "from cp.`tpch/region.parquet` \n" +
+ "limit 0";
+
+ try {
+ final TypeProtos.MajorType majorTypeDouble =
TypeProtos.MajorType.newBuilder()
+ .setMinorType(TypeProtos.MinorType.FLOAT8)
+ .setMode(TypeProtos.DataMode.REQUIRED)
+ .build();
+
+ final List<Pair<SchemaPath, TypeProtos.MajorType>>
expectedSchemaDouble = Lists.newArrayList();
+ expectedSchemaDouble.add(Pair.of(SchemaPath.getSimplePath("col"),
majorTypeDouble));
+
+ testBuilder()
--- End diff --
We had better to explicitly set the decimal option to false, before the
test on line 746. For now, the option defaults to be false. But what if it's
changed to true some day?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---