You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Hive QA (JIRA)" <ji...@apache.org> on 2017/06/10 21:44:18 UTC

[jira] [Commented] (HIVE-16881) Make extractSqlBoolean More Consistent

    [ https://issues.apache.org/jira/browse/HIVE-16881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045713#comment-16045713 ] 

Hive QA commented on HIVE-16881:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12872453/HIVE-16881.1.patch

{color:red}ERROR:{color} -1 due to no test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 8 failed/errored test(s), 10829 tests executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestMiniLlapCliDriver.testCliDriver[orc_ppd_basic] (batchId=140)
org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver[vector_if_expr] (batchId=145)
org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_2] (batchId=99)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query14] (batchId=232)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query16] (batchId=232)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query23] (batchId=232)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query94] (batchId=232)
org.apache.hive.jdbc.TestJdbcWithMiniHS2.testHttpRetryOnServerIdleTimeout (batchId=226)
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/5621/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/5621/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-5621/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 8 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12872453 - PreCommit-HIVE-Build

> Make extractSqlBoolean More Consistent
> --------------------------------------
>
>                 Key: HIVE-16881
>                 URL: https://issues.apache.org/jira/browse/HIVE-16881
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>    Affects Versions: 2.1.1, 3.0.0
>            Reporter: BELUGA BEHR
>            Priority: Trivial
>         Attachments: HIVE-16881.1.patch
>
>
> {code:title=org.apache.hadoop.hive.metastore.MetaStoreDirectSql|borderStyle=solid}
> private static Boolean extractSqlBoolean(Object value) throws MetaException {
>     // MySQL has booleans, but e.g. Derby uses 'Y'/'N' mapping. People using derby probably
>     // don't care about performance anyway, but let's cover the common case.
>     if (value == null) return null;
>     if (value instanceof Boolean) return (Boolean)value;
>     Character c = null;
>     if (value instanceof String && ((String)value).length() == 1) {
>       c = ((String)value).charAt(0);
>     }
>     if (c == null) return null;
>     if (c == 'Y') return true;
>     if (c == 'N') return false;
>     throw new MetaException("Cannot extract boolean from column value " + value);
>   }
> {code}
> It's not very clear here what the code intends.  For example, if the _value_ is "YE" then the code returns _null_.  If the _value_ is "Z" then an exception is thrown.
> # Change this to throw an exception when any invalid value is encountered
> # Add comments
> # User Apache Commons Library for parsing



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)