You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Tangruilin (via GitHub)" <gi...@apache.org> on 2024/01/31 12:37:19 UTC

[PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   ## 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.  
   -->
   releateto #8781 
   
   ## What changes are included in this PR?
   change the internal_err maroc in `datetime_expression.ts` to exec_err!
   
   <!--
   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?
   no
   <!--
   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?
   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 `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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   Thank you @comphead  and @Tangruilin 


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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   @Omega359 
   I submit a PR to change the `internal_err` to `exec_err`
   
   you can review this patch


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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   > I am uncertain as to whether the unsupported data type errors should always be internal or exec. I think it may depend on the signature of the function. For example, from_unixtime is specified as having a signature of
   > 
   > ```
   > BuiltinScalarFunction::FromUnixtime => {
   >                 Signature::uniform(1, vec![Int64], self.volatility())
   >             }
   > ```
   > 
   > so if that function got anything other than Int64 it would definitely be unexpected and thus I would think that internal_err might be appropriate there. However, to_timestamp(_xxx) methods are defined as
   > 
   > ```
   > BuiltinScalarFunction::ToTimestamp
   >             | BuiltinScalarFunction::ToTimestampSeconds
   >             | BuiltinScalarFunction::ToTimestampMillis
   >             | BuiltinScalarFunction::ToTimestampMicros
   >             | BuiltinScalarFunction::ToTimestampNanos => {
   >                 Signature::variadic_any(self.volatility())
   >             }
   > ```
   > 
   > So it would be expected that the impl would have to handle and return unacceptable types (thus exec_err)
   
   May I need to tidy up them and modify this 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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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


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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   internal_err: something that wasn't expected/anticipated by the implementation and that is most likely a bug (the error message even encourages users to open a bug report). I user should not be able to trigger this under normal circumstances. Note that I/O errors (or any error that happens due to external systems) do NOT fall under this category (there's an external error variant for that)
   
   exec_err: a processing error that happens during execution, e.g. the user passed malformed arguments to a SQL method, opened a CSV file that is broken, tried to divide an integer by zero. these errors shouldn't happen for a "good" query + "good" data, but since both the query and the data can easily be broken or misaligned, these are common occurrences in ETL systems / databases.


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


Re: [PR] refer to #8781, convert the internal_err! in datetime_expression.rs to exec_err! [arrow-datafusion]

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

   I am uncertain as to whether the unsupported data type errors should always be internal or exec. I think it may depend on the signature of the function. For example, from_unixtime is specified as having  a signature of 
   ```
   BuiltinScalarFunction::FromUnixtime => {
                   Signature::uniform(1, vec![Int64], self.volatility())
               }
   ```
   so if that function got anything other than Int64 it would definitely be unexpected and thus I would think that internal_err might be appropriate there. However, to_timestamp(_xxx) methods are defined as 
   ```
   BuiltinScalarFunction::ToTimestamp
               | BuiltinScalarFunction::ToTimestampSeconds
               | BuiltinScalarFunction::ToTimestampMillis
               | BuiltinScalarFunction::ToTimestampMicros
               | BuiltinScalarFunction::ToTimestampNanos => {
                   Signature::variadic_any(self.volatility())
               }
   ```
   So it would be expected that the impl would have to handle and return unacceptable types (thus exec_err)
   


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