[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/904


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-08 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149616688
  
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java 
---
@@ -120,4 +124,27 @@ protected LogicalExpression parseExpr(String expr) 
throws RecognitionException {
 return ret.e;
   }
 
+  /**
+   * mock current locale to US
+   */
+  public static void mockUSLocale() {
+new MockUp() {
+  @Mock
+  public DateFormatSymbols getDateFormatSymbols(Locale locale) {
+return new DateFormatSymbols(Locale.US);
+  }
+};
+  }
+
+  /**
+   * mock current timezone to UTC
--- End diff --

Please start the sentence with a capital letter and add a description about 
the method which is mocked.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-08 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149615891
  
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java 
---
@@ -120,4 +124,27 @@ protected LogicalExpression parseExpr(String expr) 
throws RecognitionException {
 return ret.e;
   }
 
+  /**
+   * mock current locale to US
--- End diff --

Please start the sentence with a capital letter and add a description about 
the method which is mocked.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-08 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149612076
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -33,128 +33,140 @@
 import org.apache.drill.exec.server.Drillbit;
 import org.apache.drill.exec.server.RemoteServiceSet;
 import org.apache.drill.exec.vector.ValueVector;
+import org.joda.time.DateTimeUtils;
 import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 import org.joda.time.LocalDateTime;
+import org.joda.time.LocalTime;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
 import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import java.text.DateFormatSymbols;
+import java.util.List;
+import java.util.Locale;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
+@RunWith(JMockit.class)
 @Category({UnlikelyTest.class, SqlFunctionTest.class})
 public class TestDateFunctions extends PopUnitTestBase {
-static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(TestDateFunctions.class);
+  static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(TestDateFunctions.class);
 
-public void testCommon(String[] expectedResults, String physicalPlan, 
String resourceFile) throws Exception {
-try (RemoteServiceSet serviceSet = 
RemoteServiceSet.getLocalServiceSet();
- Drillbit bit = new Drillbit(CONFIG, serviceSet);
- DrillClient client = new DrillClient(CONFIG, 
serviceSet.getCoordinator())) {
 
-// run query.
-bit.run();
-client.connect();
-List results = 
client.runQuery(org.apache.drill.exec.proto.UserBitShared.QueryType.PHYSICAL,
-
Files.toString(FileUtils.getResourceAsFile(physicalPlan), Charsets.UTF_8)
-.replace("#{TEST_FILE}", resourceFile));
+  public void testCommon(String[] expectedResults, String physicalPlan, 
String resourceFile) throws Exception {
+try (RemoteServiceSet serviceSet = 
RemoteServiceSet.getLocalServiceSet();
+ Drillbit bit = new Drillbit(CONFIG, serviceSet);
+ DrillClient client = new DrillClient(CONFIG, 
serviceSet.getCoordinator())) {
 
-RecordBatchLoader batchLoader = new 
RecordBatchLoader(bit.getContext().getAllocator());
+  // run query.
+  bit.run();
+  client.connect();
+  List results = 
client.runQuery(org.apache.drill.exec.proto.UserBitShared.QueryType.PHYSICAL,
+Files.toString(FileUtils.getResourceAsFile(physicalPlan), 
Charsets.UTF_8)
+  .replace("#{TEST_FILE}", resourceFile));
 
-QueryDataBatch batch = results.get(0);
-assertTrue(batchLoader.load(batch.getHeader().getDef(), 
batch.getData()));
+  RecordBatchLoader batchLoader = new 
RecordBatchLoader(bit.getContext().getAllocator());
 
+  QueryDataBatch batch = results.get(0);
+  assertTrue(batchLoader.load(batch.getHeader().getDef(), 
batch.getData()));
 
-int i = 0;
-for (VectorWrapper v : batchLoader) {
 
-ValueVector.Accessor accessor = 
v.getValueVector().getAccessor();
-System.out.println(accessor.getObject(0));
-assertEquals( expectedResults[i++], 
accessor.getObject(0).toString());
-}
-
-batchLoader.clear();
-for(QueryDataBatch b : results){
-b.release();
-}
-}
-}
-
-@Test
-@Ignore("relies on particular timezone")
-public void testDateIntervalArithmetic() throws Exception {
-String expectedResults[] = {"2009-02-23T00:00:00.000-08:00",
-"2008-02-24T00:00:00.000-08:00",
-"1970-01-01T13:20:33.000-08:00",
-"2008-02-24T12:00:00.000-08:00",
-"2009-04-23T12:00:00.000-07:00",
-"2008-02-24T12:00:00.000-08:00",
-"2009-04-23T12:00:00.000-07:00",
-"2009-02-23T00:00:00.000-08:00",
-"2008-02-24T00:00:00.000-08:00",
-"1970-01-01T13:20:33.000-08:00",
-"2008-02-24T12:00:00.000-08:00",
-"2009-04-23T12:00:00.000-07:00",
-

[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-08 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149614134
  
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java 
---
@@ -120,4 +124,27 @@ protected LogicalExpression parseExpr(String expr) 
throws RecognitionException {
 return ret.e;
   }
 
+  /**
+   * mock current locale to US
+   */
+  public static void mockUSLocale() {
--- End diff --

Please rename this method to mockUsDateFormatSymbols


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-08 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149613241
  
--- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/ExecTest.java 
---
@@ -120,4 +124,27 @@ protected LogicalExpression parseExpr(String expr) 
throws RecognitionException {
 return ret.e;
   }
 
+  /**
+   * mock current locale to US
+   */
+  public static void mockUSLocale() {
+new MockUp() {
+  @Mock
+  public DateFormatSymbols getDateFormatSymbols(Locale locale) {
+return new DateFormatSymbols(Locale.US);
+  }
+};
+  }
+
+  /**
+   * mock current timezone to UTC
+   */
+  public static void mockUTCTimezone() {
--- End diff --

Please rename this method to mockUtcDateTimeZone


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-07 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149440034
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/interp/TestConstantFolding.java
 ---
@@ -117,6 +123,13 @@ public void createFiles(int smallFileLines, int 
bigFileLines) throws Exception{
 
   @Test
   public void testConstantFolding_allTypes() throws Exception {
+new MockUp() {
--- End diff --

I meant to use the same method in all tests where Locale should be mocked. 
Please replace it.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-07 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149440814
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -77,16 +82,23 @@ public void testCastByConstantFolding() throws 
Exception {
 
   @Test // DRILL-3769
   public void testToDateForTimeStamp() throws Exception {
-final String query = "select to_date(to_timestamp(-1)) as col \n" +
-"from (values(1))";
+new MockUp() {
--- End diff --

This mock is used twice. So let's also move the code into the separate 
method.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-11-07 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r149440392
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/testing/TestDateConversions.java
 ---
@@ -225,4 +243,16 @@ public void testPostgresDateFormatError() throws 
Exception {
   throw e;
 }
   }
+
+  /**
+   * mock current locale to US
+   */
+  private void mockUSLocale() {
--- End diff --

Please move this method into ExecTest class and make it public and static.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-31 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r148002267
  
--- Diff: 
logical/src/test/java/org/apache/drill/common/expression/fn/JodaDateValidatorTest.java
 ---
@@ -119,13 +118,14 @@ public void testDateDayOfYearYearFormat() {
 
   @Test
   public void testTimeHoursMinutesSecondsFormat() {
+Locale.setDefault(Locale.US);
--- End diff --

Not sure that this change is necessary.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-31 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147997514
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewDateFunctions.java
 ---
@@ -26,14 +26,14 @@
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.sql.Date;
 
--- End diff --

When you removed unused import, two empty lines stayed. Could you please 
also remove one of them?


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-31 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147996953
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestNewDateFunctions.java
 ---
@@ -26,14 +26,14 @@
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import java.sql.Date;
 
 @Category({UnlikelyTest.class, SqlFunctionTest.class})
 public class TestNewDateFunctions extends BaseTestQuery {
   DateTime date;
   DateTimeFormatter formatter;
   long unixTimeStamp = -1;
 
+
--- End diff --

Please revert the addition of empty line there.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-31 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r148000393
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/testing/TestDateConversions.java
 ---
@@ -104,6 +110,13 @@ public void testPostgresDate() throws Exception {
 
   @Test
   public void testJodaTime() throws Exception {
+new MockUp() {
--- End diff --

Since the same block of code is used in many places, we should move it to 
the separate method (and add Javadoc). 


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-31 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r148000718
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/testing/TestDateConversions.java
 ---
@@ -117,10 +130,18 @@ public void testJodaTime() throws Exception {
   .baselineValues(true, true)
   .baselineValues(false, true)
   .go();
+
--- End diff --

Please revert the addition of empty line.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147581757
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -77,16 +83,21 @@ public void testCastByConstantFolding() throws 
Exception {
 
   @Test // DRILL-3769
   public void testToDateForTimeStamp() throws Exception {
-final String query = "select to_date(to_timestamp(-1)) as col \n" +
-"from (values(1))";
-
+final String query = "select to_date(to_timestamp(-1)) as col \n"
+  + "from (values(1))";
+new MockUp() {
--- End diff --

Please move this mock before string declaration and add an empty line after 
the mock. 


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147582599
  
--- Diff: 
logical/src/test/java/org/apache/drill/common/expression/fn/JodaDateValidatorTest.java
 ---
@@ -24,6 +24,7 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.util.Locale;
--- End diff --

Could you please revert changes, made in this class to the version, where 
you just added `.withLocale(Locale.US)` in `parseDateFromPostgres` method. My 
earlier comment was connected only with change, made in UDF function, but here, 
in the method that just used for unit tests, we can do that.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147581841
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -17,11 +17,10 @@
  */
 package org.apache.drill.exec.fn.impl;
 
+
--- End diff --

Please remove this extra empty line (and in other places, where you have 
added it). 


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-10-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r147582266
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -34,19 +33,22 @@
 import org.apache.drill.exec.server.RemoteServiceSet;
 import org.apache.drill.exec.vector.ValueVector;
 import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 import org.joda.time.LocalDateTime;
+import org.joda.time.LocalTime;
 import org.junit.Ignore;
 import org.junit.Test;
-
 import com.google.common.base.Charsets;
 import com.google.common.io.Files;
 import org.junit.experimental.categories.Category;
 
+import java.util.Locale;
+
+
 @Category({UnlikelyTest.class, SqlFunctionTest.class})
 public class TestDateFunctions extends PopUnitTestBase {
--- End diff --

This class has 4 space indentation, but according to our convention, it 
should be with 2 spaces. Since you have made changes here, could you please 
make 2 spaces indentation?



---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-09-18 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r137591528
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -135,11 +136,16 @@ public void testIntervalArithmetic() throws Exception 
{
 
 @Test
 public void testToChar() throws Exception {
-
-String expectedResults[] = {(new LocalDate(2008, 2, 
23)).toString("-MMM-dd"),
+Locale defaultLocale = Locale.getDefault();
+try{
--- End diff --

Please add spaces in all places where required.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-09-18 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r137590193
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -32,17 +29,21 @@
 import org.apache.drill.exec.server.RemoteServiceSet;
 import org.apache.drill.exec.vector.ValueVector;
 import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 import org.joda.time.LocalDateTime;
+import org.joda.time.LocalTime;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
+import java.util.List;
--- End diff --

Please remove unused imports in all classes where you have made changes.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-09-18 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r13824
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/testing/TestDateConversions.java
 ---
@@ -99,106 +100,142 @@ public void testPostgresDate() throws Exception {
 
   @Test
   public void testJodaTime() throws Exception {
-String query = String.format("SELECT to_time(time1, 'H:m:ss') = "
-  + "to_time(time2, 'h:m:ssa') as col1, "
-  + "to_time(time1, 'H:m:ss') = "
-  + "to_time(time3, 'ssmha') as col2 "
-  + "from dfs_test.`%s/joda_postgres_time.json`", TEMP_DIR);
+Locale defaultLocale = Locale.getDefault();
+try {
+  Locale.setDefault(new Locale("en", "US"));
--- End diff --

Please replace all occurrences of `new Locale("en", "US")` by `Locale.US` 
in all your changes.


---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135848539
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -22,14 +22,15 @@
 import org.apache.drill.BaseTestQuery;
 import org.apache.drill.common.util.FileUtils;
 import org.joda.time.DateTime;
+import org.junit.BeforeClass;
--- End diff --

Please remove unused imports.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135849992
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -73,16 +74,23 @@ public void testCastByConstantFolding() throws 
Exception {
 
   @Test // DRILL-3769
   public void testToDateForTimeStamp() throws Exception {
-final String query = "select to_date(to_timestamp(-1)) as col \n" +
-"from (values(1))";
+String defaultTimezone = System.getProperty("user.timezone");
+try {
+  System.setProperty("user.timezone","Etc/GMT");
--- End diff --

Please add space after the comma.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135850298
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -73,16 +74,23 @@ public void testCastByConstantFolding() throws 
Exception {
 
   @Test // DRILL-3769
   public void testToDateForTimeStamp() throws Exception {
-final String query = "select to_date(to_timestamp(-1)) as col \n" +
-"from (values(1))";
+String defaultTimezone = System.getProperty("user.timezone");
+try {
+  System.setProperty("user.timezone","Etc/GMT");
+  final String query = "select to_date(to_timestamp(-1)) as col \n"
++ "from (values(1))";
 
-testBuilder()
+  testBuilder()
 .sqlQuery(query)
 .ordered()
 .baselineColumns("col")
 .baselineValues(new DateTime(1969, 12, 31, 0, 0))
 .build()
 .run();
+}finally {
+  System.setProperty("user.timezone",defaultTimezone);
--- End diff --

space


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135850258
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java
 ---
@@ -73,16 +74,23 @@ public void testCastByConstantFolding() throws 
Exception {
 
   @Test // DRILL-3769
   public void testToDateForTimeStamp() throws Exception {
-final String query = "select to_date(to_timestamp(-1)) as col \n" +
-"from (values(1))";
+String defaultTimezone = System.getProperty("user.timezone");
+try {
+  System.setProperty("user.timezone","Etc/GMT");
+  final String query = "select to_date(to_timestamp(-1)) as col \n"
++ "from (values(1))";
 
-testBuilder()
+  testBuilder()
 .sqlQuery(query)
 .ordered()
 .baselineColumns("col")
 .baselineValues(new DateTime(1969, 12, 31, 0, 0))
 .build()
 .run();
+}finally {
--- End diff --

please add space: `} finally {`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135850825
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -20,7 +20,9 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
--- End diff --

unused imports


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #904: DRILL-5717: change some date time test cases with s...

2017-08-29 Thread vvysotskyi
Github user vvysotskyi commented on a diff in the pull request:

https://github.com/apache/drill/pull/904#discussion_r135851159
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestDateFunctions.java
 ---
@@ -135,11 +139,16 @@ public void testIntervalArithmetic() throws Exception 
{
 
 @Test
 public void testToChar() throws Exception {
-
-String expectedResults[] = {(new LocalDate(2008, 2, 
23)).toString("-MMM-dd"),
+Locale defaultLocale = Locale.getDefault();
+try{
+  Locale.setDefault(new Locale("en", "US"));
--- End diff --

Please replace `new Locale("en", "US")` by `Locale.US`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---