Skip to content
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

fix error handling in json functions with default values #8111

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

richardstartin
Copy link
Member

we caught this in our CI pipeline

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2022

Codecov Report

Merging #8111 (425c1d3) into master (ea2f0aa) will decrease coverage by 57.19%.
The diff coverage is 0.00%.

❗ Current head 425c1d3 differs from pull request most recent head 116889c. Consider uploading reports for the commit 116889c to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##             master    #8111       +/-   ##
=============================================
- Coverage     71.35%   14.15%   -57.20%     
+ Complexity     4302       81     -4221     
=============================================
  Files          1617     1572       -45     
  Lines         83896    82019     -1877     
  Branches      12543    12340      -203     
=============================================
- Hits          59866    11613    -48253     
- Misses        19944    69542    +49598     
+ Partials       4086      864     -3222     
Flag Coverage Δ
integration1 ?
integration2 ?
unittests1 ?
unittests2 14.15% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...he/pinot/common/function/scalar/JsonFunctions.java 0.00% <0.00%> (-85.00%) ⬇️
...ain/java/org/apache/pinot/core/data/table/Key.java 0.00% <0.00%> (-100.00%) ⬇️
.../java/org/apache/pinot/spi/utils/BooleanUtils.java 0.00% <0.00%> (-100.00%) ⬇️
.../java/org/apache/pinot/core/data/table/Record.java 0.00% <0.00%> (-100.00%) ⬇️
.../java/org/apache/pinot/core/util/GroupByUtils.java 0.00% <0.00%> (-100.00%) ⬇️
...ava/org/apache/pinot/spi/config/table/FSTType.java 0.00% <0.00%> (-100.00%) ⬇️
...ava/org/apache/pinot/spi/data/MetricFieldSpec.java 0.00% <0.00%> (-100.00%) ⬇️
...va/org/apache/pinot/spi/utils/BigDecimalUtils.java 0.00% <0.00%> (-100.00%) ⬇️
...java/org/apache/pinot/common/tier/TierFactory.java 0.00% <0.00%> (-100.00%) ⬇️
...java/org/apache/pinot/common/utils/StringUtil.java 0.00% <0.00%> (-100.00%) ⬇️
... and 1291 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea2f0aa...116889c. Read the comment docs.

Copy link
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@@ -89,7 +89,7 @@ public static Object jsonPath(Object object, String jsonPath) {
if (object instanceof String) {
return PARSE_CONTEXT.parse((String) object).read(jsonPath, NO_PREDICATES);
}
return PARSE_CONTEXT.parse(object).read(jsonPath, NO_PREDICATES);
return object == null ? null : PARSE_CONTEXT.parse(object).read(jsonPath, NO_PREDICATES);
Copy link
Contributor

Choose a reason for hiding this comment

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

Input object should not be null. IMO We can let it throw NPE

@richardstartin richardstartin merged commit 26bad8b into apache:master Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants