You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jackwener (via GitHub)" <gi...@apache.org> on 2023/02/09 10:00:25 UTC

[GitHub] [arrow-datafusion] jackwener opened a new pull request, #5224: fix: fix expect error in test `cast_string_to_time`

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

   # 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.
   -->
   
   Closes #.
   
   # 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.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # 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] jackwener merged pull request #5224: fix: correct expected error in test

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener merged PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224


-- 
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] HaoYang670 commented on pull request #5224: fix: correct expected error in test

Posted by "HaoYang670 (via GitHub)" <gi...@apache.org>.
HaoYang670 commented on PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#issuecomment-1425166410

   @jackwener If the error returned from `type_coercion` is the expected behavior, we can fix these when fixing #4615


-- 
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 #5224: fix: correct expected error in test

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#issuecomment-1425227330

   > ~@jackwener If the error returned from `type_coercion` is the expected behavior, we can fix these when fixing #4615~ @jackwener, could you try something like this to set `skip_failed_rules` to `false` in the test? I tested it on my desktop and it can work.
   > 
   > ```rust
   > async fn cast_string_to_time() {
   >     let config = SessionConfig::new().set("datafusion.optimizer.skip_failed_rules", ScalarValue::Boolean(Some(false)));
   >     let ctx = SessionContext::with_config(config);
   > ```
   
   It's great idea. thanks you! @HaoYang670 


-- 
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 #5224: fix: fix expect error in test `cast_string_to_time`

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#issuecomment-1423926808

   cc @HaoYang670 


-- 
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 a diff in pull request #5224: fix: correct expected error in test

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#discussion_r1102335574


##########
datafusion/core/src/physical_plan/planner.rs:
##########
@@ -2191,7 +2190,12 @@ mod tests {
             .build()?;
         let e = plan(&logical_plan).await.unwrap_err().to_string();
 
-        assert_contains!(&e, "The data type inlist should be same, the value type is Boolean, one of list expr type is Struct([Field { name: \"foo\", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }])");
+        assert_contains!(
+            &e,
+            r#"type_coercion
+caused by
+Internal error: Optimizer rule 'type_coercion' failed due to unexpected error: Error during planning: Can not find compatible types to compare Boolean with [Struct([Field { name: "foo", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }]), Utf8]. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"#
+        );

Review Comment:
   Agree with you.
   I think we can do it in next PR.



-- 
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 #5224: fix: correct expected error in test

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#issuecomment-1425435934

   Benchmark runs are scheduled for baseline = a1b6f507232e3a0a327cf7496ea56ec66be1e346 and contender = 8a262c3ec0a100607ae97641d7a374c847a71f20. 8a262c3ec0a100607ae97641d7a374c847a71f20 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/91f5d975f2ae42b38b23ff4a95afe6c1...c5d2be7906284516bbdcff61c5ac8d4b/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/155d61e96fab40629053d4419eabc76f...6471f558fc5a4fd281e04076180a03c5/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/cdd4fa306d994a6e9022c1a433de220b...e84b63e54c9d45ef8af9acec21b1e80d/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/90aad77e3c6141a0a22e35513e2a4929...82594dda3ec74346b8fe1dd96a6235bc/)
   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] jackwener commented on pull request #5224: fix: correct expected error in test

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#issuecomment-1424215528

   This PR must be with disable skip config


-- 
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] HaoYang670 commented on a diff in pull request #5224: fix: correct expected error in test

Posted by "HaoYang670 (via GitHub)" <gi...@apache.org>.
HaoYang670 commented on code in PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#discussion_r1102326985


##########
datafusion/core/tests/sql/timestamp.rs:
##########
@@ -1070,15 +1075,19 @@ async fn cast_string_to_time() {
     let result = try_execute_to_batches(&ctx, sql).await;
     assert_eq!(
         result.err().unwrap().to_string(),
-        "Arrow error: Cast error: Cannot cast string 'not a time' to value of Time64(Nanosecond) type"
+        "simplify_expressions\ncaused by\nInternal error: Optimizer rule 'simplify_expressions' failed due to unexpected error: \
+        Arrow error: Cast error: Cannot cast string 'not a time' to value of Time64(Nanosecond) type. \
+        This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"
     );
 
     // An invalid time
     let sql = "SELECT TIME '24:01:02' as time;";
     let result = try_execute_to_batches(&ctx, sql).await;
     assert_eq!(
         result.err().unwrap().to_string(),
-        "Arrow error: Cast error: Cannot cast string '24:01:02' to value of Time64(Nanosecond) type"
+        "simplify_expressions\ncaused by\nInternal error: Optimizer rule 'simplify_expressions' failed due to unexpected error: \

Review Comment:
   Ditto.



##########
datafusion/core/src/physical_plan/planner.rs:
##########
@@ -2191,7 +2190,12 @@ mod tests {
             .build()?;
         let e = plan(&logical_plan).await.unwrap_err().to_string();
 
-        assert_contains!(&e, "The data type inlist should be same, the value type is Boolean, one of list expr type is Struct([Field { name: \"foo\", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }])");
+        assert_contains!(
+            &e,
+            r#"type_coercion
+caused by
+Internal error: Optimizer rule 'type_coercion' failed due to unexpected error: Error during planning: Can not find compatible types to compare Boolean with [Struct([Field { name: "foo", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }]), Utf8]. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"#
+        );

Review Comment:
   We should update this error message somehow, because it is a type error, not a bug in Datafusion. 
   We could do this in the following PRs.



##########
datafusion/core/tests/sql/timestamp.rs:
##########
@@ -1070,15 +1075,19 @@ async fn cast_string_to_time() {
     let result = try_execute_to_batches(&ctx, sql).await;
     assert_eq!(
         result.err().unwrap().to_string(),
-        "Arrow error: Cast error: Cannot cast string 'not a time' to value of Time64(Nanosecond) type"
+        "simplify_expressions\ncaused by\nInternal error: Optimizer rule 'simplify_expressions' failed due to unexpected error: \
+        Arrow error: Cast error: Cannot cast string 'not a time' to value of Time64(Nanosecond) type. \
+        This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"

Review Comment:
   Ditto. We should find a way to update the error message when the error is expected. However, this is not a big deal now, because the default value of `skip_failed_rules` is `false` and customers won't see this error message.



-- 
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 a diff in pull request #5224: fix: correct expected error in test

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #5224:
URL: https://github.com/apache/arrow-datafusion/pull/5224#discussion_r1102335574


##########
datafusion/core/src/physical_plan/planner.rs:
##########
@@ -2191,7 +2190,12 @@ mod tests {
             .build()?;
         let e = plan(&logical_plan).await.unwrap_err().to_string();
 
-        assert_contains!(&e, "The data type inlist should be same, the value type is Boolean, one of list expr type is Struct([Field { name: \"foo\", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }])");
+        assert_contains!(
+            &e,
+            r#"type_coercion
+caused by
+Internal error: Optimizer rule 'type_coercion' failed due to unexpected error: Error during planning: Can not find compatible types to compare Boolean with [Struct([Field { name: "foo", data_type: Boolean, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }]), Utf8]. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"#
+        );

Review Comment:
   Agree with you.
   I should we can do it in next PR.



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