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/10/23 07:12:06 UTC

[GitHub] [arrow-datafusion] jackwener opened a new pull request, #3931: Refactor Expr::Cast to use a struct.

jackwener opened a new pull request, #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931

   # 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 #2175 and #3807
   
    # 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.  
   -->
   
   # 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.
   -->
   Refactor Expr::Cast to use a struct.
   
   # Are there any user-facing changes?
   <!--
   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 `api 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-datafusion] ygf11 commented on a diff in pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
ygf11 commented on code in PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931#discussion_r1002683871


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ pub struct GetIndexedField {
     pub key: ScalarValue,
 }
 
+/// BETWEEN expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct Cast {
+    /// The expression being cast
+    pub expr: Box<Expr>,
+    /// The `DataType` the expression will yield
+    pub data_type: DataType,
+}
+
+impl Cast {
+    /// Create a new Between expression
+    pub fn new(expr: Box<Expr>, data_type: DataType) -> Self {
+        Self { expr, data_type }
+    }
+}
+
 impl GetIndexedField {

Review Comment:
   Why the `struct Cast` is in the middle of `struct GetIndexedField` and `impl GetIndexedField`?



-- 
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-datafusion] jackwener commented on pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
jackwener commented on PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931#issuecomment-1288101874

   @ygf11 thanks, have resolved


-- 
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-datafusion] ygf11 commented on a diff in pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
ygf11 commented on code in PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931#discussion_r1002683636


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ pub struct GetIndexedField {
     pub key: ScalarValue,
 }
 
+/// BETWEEN expression
+#[derive(Clone, PartialEq, Eq, Hash)]

Review Comment:
   BETWEEN?



-- 
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-datafusion] ygf11 commented on a diff in pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
ygf11 commented on code in PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931#discussion_r1002683658


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ pub struct GetIndexedField {
     pub key: ScalarValue,
 }
 
+/// BETWEEN expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct Cast {
+    /// The expression being cast
+    pub expr: Box<Expr>,
+    /// The `DataType` the expression will yield
+    pub data_type: DataType,
+}
+
+impl Cast {
+    /// Create a new Between expression

Review Comment:
   BETWEEN?



-- 
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-datafusion] ursabot commented on pull request #3931: Refactor Expr::Cast to use a struct.

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

   Benchmark runs are scheduled for baseline = e669480c77dd405868299012910746c4b1b875bc and contender = b5c23c2c29f0e8ffc0f7021c78274176cf2cacb0. b5c23c2c29f0e8ffc0f7021c78274176cf2cacb0 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-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/19667448daa04686abf691c76c4f8008...047843845e4d4006b0df4ad4fdcfb67d/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/9177af56f8a2410581e8f559ff912038...ec1bb8aec1294db7acc95237ecd59bdd/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/3ff9c72ec2954cc4aa7069dcd9aa7e45...da646817b6ab4b7587dcc8c9040e873a/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/b1ef8c698a894290936ebbb51446b8bc...a2b0dbab3d4d4a87bceb3c0b2e66fb56/)
   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-datafusion] ygf11 commented on a diff in pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
ygf11 commented on code in PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931#discussion_r1002683658


##########
datafusion/expr/src/expr.rs:
##########
@@ -353,6 +348,22 @@ pub struct GetIndexedField {
     pub key: ScalarValue,
 }
 
+/// BETWEEN expression
+#[derive(Clone, PartialEq, Eq, Hash)]
+pub struct Cast {
+    /// The expression being cast
+    pub expr: Box<Expr>,
+    /// The `DataType` the expression will yield
+    pub data_type: DataType,
+}
+
+impl Cast {
+    /// Create a new Between expression

Review Comment:
   Between?



-- 
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-datafusion] andygrove merged pull request #3931: Refactor Expr::Cast to use a struct.

Posted by GitBox <gi...@apache.org>.
andygrove merged PR #3931:
URL: https://github.com/apache/arrow-datafusion/pull/3931


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