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/11/02 01:57:10 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #2998: Split out arrow-cast (#2594)

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

   # 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.
   -->
   
   Part of #2594
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   The cast kernel is a fairly substantial piece of code, that takes a non-trivial time to compile. 
   
   This is the last remaining kernel that the IO functionality, i.e. IPC, parquet, etc... depend on, and so this is a precursor to splitting them out.
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Splits out the casting logic into a separate crate
   
   # Are there any user-facing changes?
   
   No
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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] tustvold commented on pull request #2998: Split out arrow-cast (#2594)

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

   Conflicts require #3018


-- 
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] tustvold merged pull request #2998: Split out arrow-cast (#2594)

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


-- 
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] ursabot commented on pull request #2998: Split out arrow-cast (#2594)

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

   Benchmark runs are scheduled for baseline = 29b3fef8ac9b3aa6da4372fd92bd1d230e285720 and contender = cdc8d0e58d51d1770d0e5363ba2985bbd417daa9. cdc8d0e58d51d1770d0e5363ba2985bbd417daa9 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/d032e2e83a9b49848898999290d97676...1f72e26e75984bc7bdd521073170136d/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/7ab5305e469a48e7a3cdd33e48a46983...13919c9b11374b6f93af334b8b181904/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/8871047eb4df4de0abb216d73700726c...f15ec0625bc74f67a5ea3dc0e5fb7633/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/2f63e12e7a3749b0aa91edcf922e9d10...802f001821bf4de8acd5da722961a465/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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] tustvold commented on pull request #2998: Split out arrow-cast (#2594)

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

   arrow-flight failure related to #3019 


-- 
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 #2998: Split out arrow-cast (#2594)

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


##########
arrow-cast/src/cast.rs:
##########
@@ -302,30 +293,31 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 /// * To or from `StructArray`
 /// * List to primitive
 /// * Interval and duration
-pub fn cast(array: &ArrayRef, to_type: &DataType) -> Result<ArrayRef> {
+pub fn cast(array: &ArrayRef, to_type: &DataType) -> Result<ArrayRef, ArrowError> {
     cast_with_options(array, to_type, &DEFAULT_CAST_OPTIONS)
 }
 
-fn cast_integer_to_decimal128<T: ArrowNumericType>(
+fn cast_integer_to_decimal128<T: ArrowPrimitiveType>(

Review Comment:
   is there a reason to also change this from `ArrowNumericType` to `ArrowPrimitiveType`?
   
   Seems fine  as all ArrowNumericTypes` are also `ArrowPrimtiveTypes` https://docs.rs/arrow/latest/arrow/datatypes/trait.ArrowNumericType.html



##########
arrow-cast/src/display.rs:
##########
@@ -533,13 +529,23 @@ fn dict_array_value_to_string<K: ArrowPrimitiveType>(
         return Ok(String::from(""));
     }
 
-    let dict_index = keys_array.value(row).to_usize().ok_or_else(|| {
-        ArrowError::InvalidArgumentError(format!(
-            "Can not convert value {:?} at index {:?} to usize for string conversion.",
-            keys_array.value(row),
-            row
-        ))
-    })?;
-
+    let dict_index = keys_array.value(row).as_usize();
     array_value_to_string(dict_array.values(), dict_index)
 }
+
+/// Converts numeric type to a `String`
+pub fn lexical_to_string<N: lexical_core::ToLexical>(n: N) -> String {

Review Comment:
   was just moved



-- 
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] tustvold commented on a diff in pull request #2998: Split out arrow-cast (#2594)

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


##########
arrow-cast/src/cast.rs:
##########
@@ -302,30 +293,31 @@ pub fn can_cast_types(from_type: &DataType, to_type: &DataType) -> bool {
 /// * To or from `StructArray`
 /// * List to primitive
 /// * Interval and duration
-pub fn cast(array: &ArrayRef, to_type: &DataType) -> Result<ArrayRef> {
+pub fn cast(array: &ArrayRef, to_type: &DataType) -> Result<ArrayRef, ArrowError> {
     cast_with_options(array, to_type, &DEFAULT_CAST_OPTIONS)
 }
 
-fn cast_integer_to_decimal128<T: ArrowNumericType>(
+fn cast_integer_to_decimal128<T: ArrowPrimitiveType>(

Review Comment:
   ArrowNumericType is part of the arithmetic kernels which haven't been split out



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