You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/24 13:40:13 UTC

[GitHub] [arrow-rs] MazterQyou opened a new pull request, #1738: Support casting `Utf8` to `Boolean`

MazterQyou opened a new pull request, #1738:
URL: https://github.com/apache/arrow-rs/pull/1738

   # Which issue does this PR close?
   
   <!---
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   None.
   
   # Rationale for this change
   
   Casting Utf8 to Boolean is useful for comparison between the two types.
   Different Utf8 inputs might be implied as true or false Boolean type; the change implements conversion from strings [supported by PostgreSQL](https://www.postgresql.org/docs/current/datatype-boolean.html).
   
   # What changes are included in this PR?
   
   This PR implements Utf8 to Boolean cast, respecting the `cast_options.safe` value, and adds related tests.
   
   # Are there any user-facing changes?
   
   


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] nevi-me commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
nevi-me commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1140767579

   > I prefer to stick with "1", "true", "0", "false" only, but not strong opinion.
   
   I echo this, but also not a strong opinion


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
viirya commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r880824560


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   I just looked at C++ Arrow: https://github.com/apache/arrow/blob/b8431fba68e2540b3e57def0bd0ad718652c4b98/cpp/src/arrow/util/value_parsing.h#L92. Seems it only converts "0", "1", "true", "false". Should we follow it and remove "on", "off", "yes", "no"?



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] HaoYang670 commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881229487


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1661,6 +1660,34 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+/// Casts Utf8 to Boolean
+fn cast_utf8_to_boolean(from: &ArrayRef, cast_options: &CastOptions) -> Result<ArrayRef> {
+    let array = from.as_any().downcast_ref::<StringArray>().unwrap();

Review Comment:
   ```suggestion
       let array = from.as_any().downcast_ref::<StringArray>().ok_or_else(|| {
           ArrowError::ComputeError(" cannot cast the array to StringArray")
       })?;
   ```



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881091531


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   I guess removing those rare variants makes sense.
   
   > unlike T and F which are computing primitives
   
   Should `t`, `f` shorter equivalents be left in then? If yes, just `t` and `f`, or all shorter variants?
   What about whitespace trimming?



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1136261294

   Submitted and mentioned the related issue.


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881324964


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1661,6 +1660,34 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+/// Casts Utf8 to Boolean
+fn cast_utf8_to_boolean(from: &ArrayRef, cast_options: &CastOptions) -> Result<ArrayRef> {
+    let array = from.as_any().downcast_ref::<StringArray>().unwrap();

Review Comment:
   `.unwrap()` method stays in line with all other `cast_` functions that use unsafe unwrap as all of them know the type in advance since they're called from `cast_with_options` that matches the correct types before calling.



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1136179892

   @MazterQyou Yea, we prefer to have related issue submitted for tracking purpose. Thank you.


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881324964


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1661,6 +1660,34 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+/// Casts Utf8 to Boolean
+fn cast_utf8_to_boolean(from: &ArrayRef, cast_options: &CastOptions) -> Result<ArrayRef> {
+    let array = from.as_any().downcast_ref::<StringArray>().unwrap();

Review Comment:
   `.unwrap()` method stays in line with all other `cast_` functions (that use unsafe unwrap) as all of them know the type in advance since they're called from `cast_with_options` that matches the types and calls the respective function.



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] nevi-me merged pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
nevi-me merged PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881091531


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   I guess removing those rare variants makes sense.
   
   > unlike T and F which are computing primitives
   
   Should `true`, `false` shorter equivalents be left in? If yes, just `t` and `f`, or all variants? What about whitespace trimming?



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881091531


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   > unlike T and F which are computing primitives
   
   Should `true`, `false` shorter equivalents be left in? If yes, just `t` and `f`, or all variants? What about whitespace trimming?



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] viirya commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1140113421

   I prefer to stick with "1", "true", "0", "false" only, but not strong opinion.


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r882514160


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -2638,6 +2665,35 @@ mod tests {
         }
     }
 
+    #[test]
+    fn test_cast_utf8_to_bool() {
+        let a = StringArray::from(vec!["true", "false", "invalid", " Y ", ""]);
+        let array = Arc::new(a) as ArrayRef;
+        let b = cast(&array, &DataType::Boolean).unwrap();
+        let c = b.as_any().downcast_ref::<BooleanArray>().unwrap();
+        assert!(c.value(0));

Review Comment:
   Another way to write this kind of test is something like:
   
   ```rust
   let expected: BooleanArray = [Some(true), Some(false), None, Some(true), None)].collect();
   assert_eq!(c, expected);



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] nevi-me commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
nevi-me commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r880971793


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   I haven't come across "on", "off", "yes", "no" in practice. They're language specific, unlike T and F which are computing primitives.
   
   So I'd stick to "1", "true" and their inverses.



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] codecov-commenter commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1136223926

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1738](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9c19ea3) into [master](https://codecov.io/gh/apache/arrow-rs/commit/ca1d85f746099c79b43700496042ed567d95c6cc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ca1d85f) will **increase** coverage by `0.00%`.
   > The diff coverage is `94.11%`.
   
   > :exclamation: Current head 9c19ea3 differs from pull request most recent head a27a3d3. Consider uploading reports for the commit a27a3d3 to get more accurate results
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1738   +/-   ##
   =======================================
     Coverage   83.31%   83.32%           
   =======================================
     Files         196      196           
     Lines       55961    55993   +32     
   =======================================
   + Hits        46625    46656   +31     
   - Misses       9336     9337    +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [arrow/src/compute/kernels/cast.rs](https://codecov.io/gh/apache/arrow-rs/pull/1738/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9jYXN0LnJz) | `95.74% <94.11%> (-0.04%)` | :arrow_down: |
   | [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/1738/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9kYXRhdHlwZS5ycw==) | `65.42% <0.00%> (-0.38%)` | :arrow_down: |
   | [arrow/src/array/transform/mod.rs](https://codecov.io/gh/apache/arrow-rs/pull/1738/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2FycmF5L3RyYW5zZm9ybS9tb2QucnM=) | `86.85% <0.00%> (+0.11%)` | :arrow_up: |
   | [parquet\_derive/src/parquet\_field.rs](https://codecov.io/gh/apache/arrow-rs/pull/1738/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldF9kZXJpdmUvc3JjL3BhcnF1ZXRfZmllbGQucnM=) | `65.98% <0.00%> (+0.22%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ca1d85f...a27a3d3](https://codecov.io/gh/apache/arrow-rs/pull/1738?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#issuecomment-1135939636

   Should I submit a related issue?


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881091531


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   I guess removing those rare variants makes sense.
   
   > unlike T and F which are computing primitives
   
   Should `true`, `false` shorter equivalents be left in? If yes, just `t` and `f`, or all variants?
   What about whitespace trimming?



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
alamb commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r882041930


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -1661,6 +1660,34 @@ fn cast_string_to_timestamp_ns<Offset: OffsetSizeTrait>(
     Ok(Arc::new(array) as ArrayRef)
 }
 
+/// Casts Utf8 to Boolean
+fn cast_utf8_to_boolean(from: &ArrayRef, cast_options: &CastOptions) -> Result<ArrayRef> {
+    let array = from.as_any().downcast_ref::<StringArray>().unwrap();

Review Comment:
   You can also use `as_string_array()` function if you want to save some typing



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] MazterQyou commented on a diff in pull request #1738: Support casting `Utf8` to `Boolean`

Posted by GitBox <gi...@apache.org>.
MazterQyou commented on code in PR #1738:
URL: https://github.com/apache/arrow-rs/pull/1738#discussion_r881181334


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -280,6 +280,8 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 ///
 /// Behavior:
 /// * Boolean to Utf8: `true` => '1', `false` => `0`
+/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,

Review Comment:
   > I haven't come across "on", "off", "yes", "no" in practice
   
   Actually, I just remembered that `YES`, `NO` variants are used in [ANSI `information_schema`](https://en.wikipedia.org/wiki/Information_schema) views.
   



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org