You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "hiltontj (via GitHub)" <gi...@apache.org> on 2024/03/22 13:51:28 UTC

[I] `DatafusionError` variant for parameter substitution during logical planning [arrow-datafusion]

hiltontj opened a new issue, #9738:
URL: https://github.com/apache/arrow-datafusion/issues/9738

   ### Is your feature request related to a problem or challenge?
   
   Currently, when replacing `ParamValue`s during logical planning, if there are missing parameters in what was provided, a `DatafusionError::Internal` will be returned.
   
   For example, in our service, we are passing query parameters via an HTTP request along with a query string. Consider this query:
   ```
   SELECT * FROM foo WHERE bar = $bar
   ```
   We would expect that the user passes something like:
   ```json
   {
     "params": {
       "bar": "baz"
     }
   }
   ```
   in the request, along with the query string. But, if they do not, then we would like to return a `4xx` error code, instead of a `5xx`.
   
   ### Describe the solution you'd like
   
   It would be nice if a specific variant was returned, e.g., `DatafusionError::MissingParameters`, as this would allow us to handle this error differently than other `Internal` errors.
   
   ### Describe alternatives you've considered
   
   We could parse the `Internal` error message, but that is not very convenient.
   
   ### Additional context
   
   n/a


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] `DatafusionError` variant for parameter substitution during logical planning [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #9738: `DatafusionError` variant for parameter substitution during logical planning
URL: https://github.com/apache/arrow-datafusion/issues/9738


-- 
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: [I] `DatafusionError` variant for parameter substitution during logical planning [arrow-datafusion]

Posted by "hiltontj (via GitHub)" <gi...@apache.org>.
hiltontj commented on issue #9738:
URL: https://github.com/apache/arrow-datafusion/issues/9738#issuecomment-2015585927

   @alamb - this is the specific error that we have run into: https://github.com/apache/arrow-datafusion/blob/47f4b5a67ac3b327764cbd4c0f42da7ac44854e5/datafusion/common/src/param_value.rs#L96-L98
   
   We are using a map of named parameters, and not a list, but the `Internal` errors returned from the same function for indexed list parameters there could potentially get similar treatment.


-- 
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: [I] `DatafusionError` variant for parameter substitution during logical planning [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #9738:
URL: https://github.com/apache/arrow-datafusion/issues/9738#issuecomment-2015438077

   I agree an error like `DataFusionError::Execution` or `DataFusionError::Plan` would be better in this case. 
   
   @hiltontj  do you have the exact error message that is being hit (to make it easier to find what part of the code needs to be changed)?


-- 
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: [I] `DatafusionError` variant for parameter substitution during logical planning [arrow-datafusion]

Posted by "erratic-pattern (via GitHub)" <gi...@apache.org>.
erratic-pattern commented on issue #9738:
URL: https://github.com/apache/arrow-datafusion/issues/9738#issuecomment-2015620799

   I'll put together a PR for this today


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