[
https://issues.apache.org/jira/browse/GOBBLIN-2211?focusedWorklogId=975843&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-975843
]
ASF GitHub Bot logged work on GOBBLIN-2211:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jul/25 11:21
Start Date: 23/Jul/25 11:21
Worklog Time Spent: 10m
Work Description: NamsB7 commented on code in PR #4121:
URL: https://github.com/apache/gobblin/pull/4121#discussion_r2225232191
##########
gobblin-metastore/src/main/java/org/apache/gobblin/metastore/MysqlErrorPatternStore.java:
##########
@@ -279,64 +302,46 @@ public List<ErrorPatternProfile>
getErrorPatternsByCategory(String categoryName)
}
@Override
- public Category getDefaultCategory()
+ public ErrorCategory getDefaultCategory()
throws IOException {
- if (hasIsDefaultColumn()) {
- Category cat = getDefaultCategoryFromIsDefault();
+ // 1. Try to use the configured default category name if set
+ if (configuredDefaultCategoryName != null &&
!configuredDefaultCategoryName.trim().isEmpty()) {
+ ErrorCategory cat = getErrorCategory(configuredDefaultCategoryName);
if (cat != null) {
return cat;
+ } else {
+ // Throw exception if configured category doesn't exist
+ throw new IOException(String.format(
+ "Configured default category '%s' not found in database",
+ configuredDefaultCategoryName));
}
}
- // Fallback to previous logic: category with the highest priority (lowest
priority number)
- return getHighestPriorityCategory();
- }
- /**
- * Returns the category with the highest priority, i.e. the lowest priority
value (ascending order).
- */
- private Category getHighestPriorityCategory()
- throws IOException {
- try (Connection conn = dataSource.getConnection(); PreparedStatement ps =
conn.prepareStatement(
- String.format(GET_HIGHEST_ERROR_CATEGORY_STATEMENT,
errorCategoriesTable))) {
- try (ResultSet rs = ps.executeQuery()) {
- if (rs.next()) {
- return new Category(rs.getString(1), rs.getInt(2));
- }
- }
- } catch (SQLException e) {
- throw new IOException("Failed to get category", e);
+ // 2. No configuration provided - use lowest priority category as fallback
+ ErrorCategory lowestPriorityCategory = getLowestPriorityCategory();
+ if (lowestPriorityCategory == null) {
+ throw new IOException("No error categories found in database");
}
- return null;
- }
- /**
- * Checks if the is_default column exists in the categories table.
- */
- private boolean hasIsDefaultColumn()
- throws IOException {
- try (Connection conn = dataSource.getConnection()) {
- try (ResultSet rs = conn.getMetaData().getColumns(null, null,
errorCategoriesTable, "is_default")) {
- return rs.next();
- }
- } catch (SQLException e) {
- throw new IOException("Failed to check for is_default column", e);
- }
+ log.debug("No default category configured, using lowest priority category:
{}",
Review Comment:
Addressed
Issue Time Tracking
-------------------
Worklog Id: (was: 975843)
Time Spent: 4.5h (was: 4h 20m)
> Implement Error Classification based on execution issues
> --------------------------------------------------------
>
> Key: GOBBLIN-2211
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2211
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-service
> Reporter: Abhishek Jain
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 4.5h
> Remaining Estimate: 0h
>
> Implement Error Classification to categorize the failure reason based on
> issues encountered.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)