Github user gparai commented on a diff in the pull request:

    https://github.com/apache/drill/pull/610#discussion_r85038037
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/sql/TestSimpleCastFunctions.java
 ---
    @@ -18,18 +18,108 @@
     package org.apache.drill.exec.sql;
     
     import org.apache.drill.BaseTestQuery;
    +import org.apache.drill.common.exceptions.UserRemoteException;
     import org.junit.Test;
     
    +import java.util.Arrays;
    +import java.util.List;
    +
    +import static org.hamcrest.CoreMatchers.containsString;
    +import static org.junit.Assert.assertThat;
    +
     public class TestSimpleCastFunctions extends BaseTestQuery {
    -  static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(TestSimpleCastFunctions.class);
     
       @Test
    -  public void castFromBoolean() throws Exception {
    -    test("select cast(false as varchar(5)), cast(true as varchar(4)), 
cast((1 < 5) as varchar(4)) from sys.options limit 1;");
    +  public void testCastFromBooleanToString() throws Exception {
    +    testBuilder()
    +        .sqlQuery("select" +
    +            " cast(false as varchar(5)) c1," +
    +            " cast(true as varchar(4)) c2," +
    +            " cast((1 < 5) as varchar(4)) c3," +
    +            " cast((1 > 5) as varchar(5)) c4" +
    +            " from (values(1))")
    +        .unOrdered()
    +        .baselineColumns("c1", "c2", "c3", "c4")
    +        .baselineValues("false", "true", "true", "false")
    +        .go();
    +  }
    +
    +  @Test
    +  public void testCastStringToBooleanTrueValue() throws Exception {
    +    List<String> literals =  Arrays.asList("t", "true", "y", "yes", "on", 
"1");
    --- End diff --
    
    Would be good to also check for case insensitivity here and in 
testCastStringToBooleanFalseValue?


---
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.
---

Reply via email to