Skip to content

Conversation

@clairemcginty
Copy link
Contributor

No description provided.

Comment on lines +206 to +211
} catch (Exception e) {
throw new RuntimeException(String.format(
"Failed to build Avro schema for sqlType %d %s [%s, %s]",
columnType, typeName, columnClassName, columnTypeName
), e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind the idea. I think in the new version of dbeam though the exceptions won't be as bad, but wrapping the code and reporting which field had an issue could still be useful anyways. Maybe it would look cleaner with a new helper function such as convertField(), then in createAvroFields() in the loop, we call convertField() on each field and that is wrapped in try-catch block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice idea! will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh, tried out the helper function and i think it was overall messier because there's like 5 variables we need to pass in per field, and extra 2 containing state from the outer loop. might be more trouble than it's worth :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fair enough, I'm fine with just wrapping the whole code block in try-catch then

@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.96%. Comparing base (05add13) to head (b2fc9c1).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1021      +/-   ##
============================================
+ Coverage     91.92%   91.96%   +0.03%     
  Complexity      283      283              
============================================
  Files            27       27              
  Lines          1015     1020       +5     
  Branches         86       86              
============================================
+ Hits            933      938       +5     
  Misses           54       54              
  Partials         28       28              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants