Hive
  1. Hive
  2. HIVE-3635

allow 't', 'T', '1', 'f', 'F', and '0' to be allowable true/false values for the boolean hive type

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.14.0
    • Component/s: CLI
    • Labels:
      None
    • Release Note:
      New configuration, hive.lazysimple.extended_boolean_literal, needs to be documented.

      Description

      interpret t as true and f as false for boolean types. PostgreSQL exports represent it that way.

      1. HIVE-3635.patch
        0.9 kB
        Alexander Alten-Lorenz
      2. HIVE-3635.1.patch
        17 kB
        Xuefu Zhang
      3. HIVE-3635.2.patch
        17 kB
        Xuefu Zhang

        Issue Links

          Activity

          Show
          Alexander Alten-Lorenz added a comment - https://reviews.apache.org/r/7759/
          Hide
          Esteban Gutierrez added a comment -

          It might be good to add a property to maintain consistency if the user doesn't require this behavior by default. Probably something like 'hive.extended.boolean = [false|true]'

          Show
          Esteban Gutierrez added a comment - It might be good to add a property to maintain consistency if the user doesn't require this behavior by default. Probably something like 'hive.extended.boolean = [false|true] '
          Hide
          Shreepadma Venugopalan added a comment -

          The changes to LazyBoolean.java look good. +1 to what Esteban said. It would be good to have a way to turn this off.

          Show
          Shreepadma Venugopalan added a comment - The changes to LazyBoolean.java look good. +1 to what Esteban said. It would be good to have a way to turn this off.
          Hide
          Alexander Alten-Lorenz added a comment -

          +1 - will do

          Show
          Alexander Alten-Lorenz added a comment - +1 - will do
          Hide
          Carl Steinbach added a comment -

          @Alex: I left some comments on reviewboard. Thanks.

          Show
          Carl Steinbach added a comment - @Alex: I left some comments on reviewboard. Thanks.
          Hide
          Alexander Alten-Lorenz added a comment -

          Replaced available patch here with the newer one.

          Show
          Alexander Alten-Lorenz added a comment - Replaced available patch here with the newer one.
          Hide
          Edward Capriolo added a comment -

          Is this a standard? We have to be careful when we change behavior of already existing code.It seems like the right thing to do but their could be unexpected surprises. What is the standard? Is there one? What do other databases to besides postgres?

          Show
          Edward Capriolo added a comment - Is this a standard? We have to be careful when we change behavior of already existing code.It seems like the right thing to do but their could be unexpected surprises. What is the standard? Is there one? What do other databases to besides postgres?
          Hide
          Namit Jain added a comment -

          Can you answer Edward's question ? and also refresh.

          Show
          Namit Jain added a comment - Can you answer Edward's question ? and also refresh.
          Hide
          Alexander Alten-Lorenz added a comment -

          Sorry, missed this. I fixed the indentation only and replaced the attached one with the fixed one. No other code changes where done.

          Show
          Alexander Alten-Lorenz added a comment - Sorry, missed this. I fixed the indentation only and replaced the attached one with the fixed one. No other code changes where done.
          Hide
          Xuefu Zhang added a comment -

          Alexander Alten-Lorenz I understand that this have been idle for a while, but are you interested in moving this forward?

          Show
          Xuefu Zhang added a comment - Alexander Alten-Lorenz I understand that this have been idle for a while, but are you interested in moving this forward?
          Hide
          Thejas M Nair added a comment -

          Xuefu Zhang Does the standard say anything about this behavior ? What do other databases do ?

          Show
          Thejas M Nair added a comment - Xuefu Zhang Does the standard say anything about this behavior ? What do other databases do ?
          Hide
          Xuefu Zhang added a comment -

          Thejas M Nair I found no standard regarding this. SQL standards define three literal values for boolean: TRUE, FALSE, and UNKNOWN [1]. The standard is also controversial, and as a result, different DB has different implementations [2].

          It seems that only Postgre SQL allows this. Other legacy data, such as that in MS Access, may also have this. That's why I think it makes sense to have a configuration or serde property to turn this on only if it's desired.

          [1] http://en.wikipedia.org/wiki/Boolean_data_type
          [2] http://community.actian.com/wiki/SQL_BOOLEAN_type

          Show
          Xuefu Zhang added a comment - Thejas M Nair I found no standard regarding this. SQL standards define three literal values for boolean: TRUE, FALSE, and UNKNOWN [1] . The standard is also controversial, and as a result, different DB has different implementations [2] . It seems that only Postgre SQL allows this. Other legacy data, such as that in MS Access, may also have this. That's why I think it makes sense to have a configuration or serde property to turn this on only if it's desired. [1] http://en.wikipedia.org/wiki/Boolean_data_type [2] http://community.actian.com/wiki/SQL_BOOLEAN_type
          Hide
          Xuefu Zhang added a comment -

          Patch #1 is based on #0, but provides configuration parameter and test.

          Show
          Xuefu Zhang added a comment - Patch #1 is based on #0, but provides configuration parameter and test.
          Hide
          Xuefu Zhang added a comment -
          Show
          Xuefu Zhang added a comment - RB: https://reviews.apache.org/r/18382/
          Hide
          Xuefu Zhang added a comment -

          Patch #2 removed trailing spaces and added missing data file.

          Show
          Xuefu Zhang added a comment - Patch #2 removed trailing spaces and added missing data file.
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

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

          ERROR: -1 due to 3 failed/errored test(s), 5177 tests executed
          Failed tests:

          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_bucket_num_reducers
          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_schemeAuthority
          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_schemeAuthority2
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1465/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1465/console

          Messages:

          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: 3 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12630409

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12630409/HIVE-3635.2.patch ERROR: -1 due to 3 failed/errored test(s), 5177 tests executed Failed tests: org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_bucket_num_reducers org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_schemeAuthority org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_schemeAuthority2 Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1465/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1465/console Messages: 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: 3 tests failed This message is automatically generated. ATTACHMENT ID: 12630409
          Hide
          Xuefu Zhang added a comment -

          The test failures are unrelated to the patch, and they are seen in other test runs. Patch is ready for review.

          Show
          Xuefu Zhang added a comment - The test failures are unrelated to the patch, and they are seen in other test runs. Patch is ready for review.
          Hide
          Brock Noland added a comment -

          +1 LGTM

          Show
          Brock Noland added a comment - +1 LGTM
          Hide
          Xuefu Zhang added a comment -

          Patch committed to trunk. Thanks Brock for the review.

          Show
          Xuefu Zhang added a comment - Patch committed to trunk. Thanks Brock for the review.

            People

            • Assignee:
              Xuefu Zhang
              Reporter:
              Alexander Alten-Lorenz
            • Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development