dongjoon-hyun commented on a change in pull request #26010: [SPARK-29342][SQL] 
Make casting of string values to intervals case insensitive
URL: https://github.com/apache/spark/pull/26010#discussion_r330943802
 
 

 ##########
 File path: 
common/unsafe/src/test/java/org/apache/spark/unsafe/types/CalendarIntervalSuite.java
 ##########
 @@ -104,31 +104,6 @@ public void fromStringTest() {
     assertNull(fromString(input));
   }
 
-  @Test
-  public void fromCaseInsensitiveStringTest() {
-    for (String input : new String[]{"5 MINUTES", "5 minutes", "5 Minutes"}) {
-      assertEquals(fromCaseInsensitiveString(input), new CalendarInterval(0, 
5L * 60 * 1_000_000));
-    }
-
-    for (String input : new String[]{null, "", " "}) {
-      try {
-        fromCaseInsensitiveString(input);
-        fail("Expected to throw an exception for the invalid input");
-      } catch (IllegalArgumentException e) {
-        assertTrue(e.getMessage().contains("cannot be null or blank"));
-      }
-    }
-
-    for (String input : new String[]{"interval", "interval1 day", "foo", "foo 
1 day"}) {
-      try {
-        fromCaseInsensitiveString(input);
-        fail("Expected to throw an exception for the invalid input");
-      } catch (IllegalArgumentException e) {
-        assertTrue(e.getMessage().contains("Invalid interval"));
-      }
-    }
 
 Review comment:
   Usually, we should not remove the test case to prevent mistakes during this 
kind of refactoring. For example, line 113 ~ 129 looks important error handling 
cases.
   
   What is the real reason to remove this test coverage?
   1. Is it prevented from our `SQL parser` already?
   2. `Pattern.CASE_INSENSITIVE` doesn't support this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to