Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1232#discussion_r184051298
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/store/parquet/TestFixedlenDecimal.java
---
@@ -20,61 +20,74 @@
import org.apache.drill.categories.UnlikelyTest;
import org.apache.drill.test.BaseTestQuery;
import org.apache.drill.exec.planner.physical.PlannerSettings;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category({UnlikelyTest.class})
public class TestFixedlenDecimal extends BaseTestQuery {
- // enable decimal data type
- @BeforeClass
- public static void enableDecimalDataType() throws Exception {
- test(String.format("alter session set `%s` = true",
PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY));
- }
-
private static final String DATAFILE =
"cp.`parquet/fixedlenDecimal.parquet`";
@Test
public void testNullCount() throws Exception {
- testBuilder()
- .sqlQuery("select count(*) as c from %s where department_id is
null", DATAFILE)
- .unOrdered()
- .baselineColumns("c")
- .baselineValues(1L)
- .build()
- .run();
+ try {
+ alterSession(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY, true);
+ testBuilder()
+ .sqlQuery("select count(*) as c from %s where department_id is
null", DATAFILE)
+ .unOrdered()
+ .baselineColumns("c")
+ .baselineValues(1L)
+ .build()
+ .run();
+ } finally {
+ resetSessionOption(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY);
+ }
}
@Test
public void testNotNullCount() throws Exception {
- testBuilder()
- .sqlQuery("select count(*) as c from %s where department_id is not
null", DATAFILE)
- .unOrdered()
- .baselineColumns("c")
- .baselineValues(106L)
- .build()
- .run();
+ try {
+ alterSession(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY, true);
+ testBuilder()
+ .sqlQuery("select count(*) as c from %s where department_id is
not null", DATAFILE)
+ .unOrdered()
+ .baselineColumns("c")
+ .baselineValues(106L)
+ .build()
--- End diff --
Thanks, replaced here and in other places.
---