aboutsummaryrefslogtreecommitdiff
path: root/contrib/storage-hive
diff options
context:
space:
mode:
authorTimothy Farkas <timothyfarkas@apache.org>2018-05-22 16:04:02 -0700
committerSorabh Hamirwasia <sorabh@apache.org>2018-06-06 09:06:33 -0700
commitf53fd1db66f19a7055dc75a43caf1da4d09b99f0 (patch)
treee7df94a05931047d13a9b32a7734681c6295f76b /contrib/storage-hive
parente0c39e070bb696d2bc67f60f18559e5a547208ad (diff)
DRILL-6438: Remove excess logging form the tests.
- Removed usages of System.out and System.err from the test and replaced with loggers closes #1284
Diffstat (limited to 'contrib/storage-hive')
-rw-r--r--contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestHiveUDFs.java22
-rw-r--r--contrib/storage-hive/core/src/test/java/org/apache/drill/exec/test/Drill2130StorageHiveCoreHamcrestConfigurationTest.java5
2 files changed, 2 insertions, 25 deletions
diff --git a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestHiveUDFs.java b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestHiveUDFs.java
index 305d9b574..7843b3fe4 100644
--- a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestHiveUDFs.java
+++ b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestHiveUDFs.java
@@ -44,8 +44,6 @@ public class TestHiveUDFs extends BaseTestQuery {
@Test
public void testGenericUDF() throws Throwable {
-
- int numRecords = 0;
String planString = Resources.toString(Resources.getResource("functions/hive/GenericUDF.json"), Charsets.UTF_8);
List<QueryDataBatch> results = testPhysicalWithResults(planString);
@@ -82,10 +80,6 @@ public class TestHiveUDFs extends BaseTestQuery {
String concat = new String(concatV.getAccessor().get(i), Charsets.UTF_8);
assertTrue(concat.equals(in+"-"+in));
- float flt1 = flt1V.getAccessor().get(i);
- String format_number = new String(format_numberV.getAccessor().get(i), Charsets.UTF_8);
-
-
String nullableStr1 = null;
if (!nullableStr1V.getAccessor().isNull(i)) {
nullableStr1 = new String(nullableStr1V.getAccessor().get(i), Charsets.UTF_8);
@@ -100,23 +94,15 @@ public class TestHiveUDFs extends BaseTestQuery {
if (nullableStr1 != null) {
assertEquals(nullableStr1.toUpperCase(), upperNullableStr1);
}
-
- System.out.println(in + ", " + upper + ", " + concat + ", " +
- flt1 + ", " + format_number + ", " + nullableStr1 + ", " + upperNullableStr1);
-
- numRecords++;
}
result.release();
batchLoader.clear();
}
-
- System.out.println("Processed " + numRecords + " records");
}
@Test
public void testUDF() throws Throwable {
- int numRecords = 0;
String planString = Resources.toString(Resources.getResource("functions/hive/UDF.json"), Charsets.UTF_8);
List<QueryDataBatch> results = testPhysicalWithResults(planString);
@@ -146,8 +132,6 @@ public class TestHiveUDFs extends BaseTestQuery {
long str1Length = str1LengthV.getAccessor().get(i);
assertTrue(str1.length() == str1Length);
- int str1Ascii = str1AsciiV.getAccessor().get(i);
-
float flt1 = flt1V.getAccessor().get(i);
double pow = 0;
@@ -155,16 +139,10 @@ public class TestHiveUDFs extends BaseTestQuery {
pow = powV.getAccessor().get(i);
assertTrue(Math.pow(flt1, 2.0) == pow);
}
-
- System.out.println(str1 + ", " + str1Length + ", " + str1Ascii + ", " + flt1 + ", " + pow);
- numRecords++;
}
result.release();
batchLoader.clear();
}
-
- System.out.println("Processed " + numRecords + " records");
}
-
}
diff --git a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/test/Drill2130StorageHiveCoreHamcrestConfigurationTest.java b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/test/Drill2130StorageHiveCoreHamcrestConfigurationTest.java
index 472891868..12adf92e5 100644
--- a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/test/Drill2130StorageHiveCoreHamcrestConfigurationTest.java
+++ b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/test/Drill2130StorageHiveCoreHamcrestConfigurationTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
import static org.hamcrest.CoreMatchers.equalTo;
public class Drill2130StorageHiveCoreHamcrestConfigurationTest {
+ private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Drill2130StorageHiveCoreHamcrestConfigurationTest.class);
@SuppressWarnings("unused")
private org.hamcrest.MatcherAssert forCompileTimeCheckForNewEnoughHamcrest;
@@ -38,9 +39,7 @@ public class Drill2130StorageHiveCoreHamcrestConfigurationTest {
+ " Got NoSuchMethodError; e: " + e );
}
catch ( AssertionError e ) {
- System.out.println( "Class path seems fine re new JUnit vs. old Hamcrest."
- + " (Got AssertionError, not NoSuchMethodError.)" );
+ logger.info("Class path seems fine re new JUnit vs. old Hamcrest. (Got AssertionError, not NoSuchMethodError.)");
}
}
-
}