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/04/29 14:21:33 UTC

[GitHub] [arrow] rtpsw opened a new pull request, #13032: ARROW-16416: [C++] Support cast-function in Substrait

rtpsw opened a new pull request, #13032:
URL: https://github.com/apache/arrow/pull/13032

   The cast-function is special in Arrow, because its operation is determined by its output type rather than just by its parameter, and so it requires special handling in Substrait to support it.


-- 
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] ursabot commented on pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

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

   Benchmark runs are scheduled for baseline = 3c03d4936445781e29e41392d9a0bc3db62b39f2 and contender = f8d6eac3d97876eed43faa9aaec9f1201dec55ba. f8d6eac3d97876eed43faa9aaec9f1201dec55ba is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/56cc55ea52d64be1bd41f46c05ef732b...ff1b8cdce40c4269bd7b9bc7af761876/)
   [Finished :arrow_down:0.7% :arrow_up:0.04%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/2c14d2e209274ec386712905ff94b745...4cadbee0f5d94ba694eda41f4440c573/)
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/1a00a92dd97a491f80392f66b540c7e2...3cb5c9a217ce43e3a580a511ac928b20/)
   [Finished :arrow_down:0.35% :arrow_up:0.04%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/8004825403d44364958a5e45231c19e6...b1e8dfa00170401ba7fb2205182fc27c/)
   Buildkite builds:
   [Finished] [`f8d6eac3` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/674)
   [Finished] [`f8d6eac3` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/671)
   [Finished] [`f8d6eac3` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/660)
   [Finished] [`f8d6eac3` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/676)
   [Finished] [`3c03d493` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/673)
   [Finished] [`3c03d493` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/670)
   [Finished] [`3c03d493` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/659)
   [Finished] [`3c03d493` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/675)
   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] github-actions[bot] commented on pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13032:
URL: https://github.com/apache/arrow/pull/13032#issuecomment-1113378408

   :warning: Ticket **has not been started in JIRA**, please click 'Start Progress'.


-- 
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] westonpace closed pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

Posted by GitBox <gi...@apache.org>.
westonpace closed pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait
URL: https://github.com/apache/arrow/pull/13032


-- 
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] github-actions[bot] commented on pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13032:
URL: https://github.com/apache/arrow/pull/13032#issuecomment-1113378362

   :warning: Ticket **has no components in JIRA**, make sure you assign one.


-- 
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] github-actions[bot] commented on pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13032:
URL: https://github.com/apache/arrow/pull/13032#issuecomment-1113378296

   https://issues.apache.org/jira/browse/ARROW-16416


-- 
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] westonpace commented on a diff in pull request #13032: ARROW-16416: [C++] Support cast-function in Substrait

Posted by GitBox <gi...@apache.org>.
westonpace commented on code in PR #13032:
URL: https://github.com/apache/arrow/pull/13032#discussion_r862108441


##########
cpp/src/arrow/engine/substrait/expression_internal.cc:
##########
@@ -165,7 +165,15 @@ Result<compute::Expression> FromProto(const substrait::Expression& expr,
         ARROW_ASSIGN_OR_RAISE(arguments[i], FromProto(scalar_fn.args(i), ext_set));
       }
 
-      return compute::call(decoded_function.name.to_string(), std::move(arguments));
+      auto func_name = decoded_function.name.to_string();
+      if (func_name != "cast") {
+        return compute::call(func_name, std::move(arguments));
+      } else {
+        ARROW_ASSIGN_OR_RAISE(auto output_type_desc,
+                              FromProto(scalar_fn.output_type(), ext_set));
+        auto cast_options = compute::CastOptions::Safe(output_type_desc.first);
+        return compute::call(func_name, std::move(arguments), cast_options);

Review Comment:
   ```suggestion
           auto cast_options = compute::CastOptions::Safe(std::move(output_type_desc.first));
           return compute::call(func_name, std::move(arguments), std::move(cast_options));
   ```
   



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