-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor query error handling to use QueryErrorCode and QueryErrorMessage for improved clarity and consistency #15037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sage for improved clarity and consistency
2308828 to
9fd0886
Compare
…ge constructor for improved JSON serialization
… error codes instead of messages
…lingTest to focus on error codes
…stead of messages
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15037 +/- ##
============================================
+ Coverage 61.75% 63.63% +1.88%
- Complexity 207 1461 +1254
============================================
Files 2436 2764 +328
Lines 133233 155674 +22441
Branches 20636 23935 +3299
============================================
+ Hits 82274 99069 +16795
- Misses 44911 49129 +4218
- Partials 6048 7476 +1428
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…tions during result streaming
…n various classes
… cleanUpQueryExceptions
|
I've pushed several changes to fix most of the comments from @yashmayya. I think I also commented on the open discussions |
|
I'll take a look at this PR today. |
|
@gortiz I didn't follow why we reintroduced the truncated stack traces in the error data blocks here? Are you planning to remove it in a follow-up PR instead? Any reason we couldn't have removed it here itself like you'd done previously? |
| */ | ||
| List<QueryProcessingException> getExceptions(); | ||
| // TODO: Rename this method | ||
| List<BrokerResponseErrorMessage> getExceptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will cause backward incompatibility for clients. If you search for QueryProcessingException in:
org:startreedata- there are multiple places where it is used in startree-pinot. It will help if you have a PR ready to remove references as it is not trivial for others to fix the compilation issue- All of github - It is used trinodb. https://github.com/trinodb/trino/pull/14399/files
I suggest you deprecate and keep this function as is. Anyway you plan to rename it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR will break backward compatibility, that is expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see, that is part of the driver. We should not break backward compatibility there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've renamed the name back to the original one
| @Deprecated | ||
| @JsonIgnore | ||
| default List<QueryProcessingException> getProcessingExceptions() { | ||
| default List<BrokerResponseErrorMessage> getProcessingExceptions() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Keep as is.
I still plan to clean up most stack traces and try to not send them to the final user. But that change should be done at the same time we improve the error codes, messages and logs. That is why I think it is better to keep the stack traces in this PR and then create one where we apply the other changes. |
|
checks are green again |
| try { | ||
| arguments[i] = parameterType.convert(argument, argumentType); | ||
| } catch (Exception e) { | ||
| String errorMsg = "Invalid conversion when calling " + _method + ": " + e.getMessage(); | ||
| throw QueryErrorCode.QUERY_EXECUTION.asException(errorMsg, e); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called in various ingestion paths as well, I don't think we should be using query execution error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, when ingestion calls this code, what they are using is to evaluate some built-in functions to apply transformations. I think it makes sense to receive query exceptions in that case. Don't you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree that query processing related exceptions should ever be used in ingestion related error paths even if function related (since those are common components). But I'd prefer to not block this PR any longer, so we can discuss this further separately.
pinot-common/src/main/java/org/apache/pinot/common/response/BrokerResponse.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/exception/EarlyTerminationException.java
Show resolved
Hide resolved
| try { | ||
| arguments[i] = parameterType.convert(argument, argumentType); | ||
| } catch (Exception e) { | ||
| String errorMsg = "Invalid conversion when calling " + _method + ": " + e.getMessage(); | ||
| throw QueryErrorCode.QUERY_EXECUTION.asException(errorMsg, e); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree that query processing related exceptions should ever be used in ingestion related error paths even if function related (since those are common components). But I'd prefer to not block this PR any longer, so we can discuss this further separately.
…ng and directly throwing QueryException
|
I've pushed a change where I'm creating a new |
This PR derives from #14994. Here, I'm applying the bigger refactors required to clean up the error hierarchy. Although the number of lines changed is pretty extensive, the actual changes are:
org.apache.pinot.spi.exception:org.apache.pinot.common.exception.QueryException).testQueryException("SELECT COUNT(*) FROM mytable where ArrTime = 'potato'"fails withQUERY_EXECUTIONin MSE (as you can see in testBaseClusterIntegrationTestSet