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 NPE when fetching a non-exist key from a GroupBy w/ derivation #922

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xiaohui-sun
Copy link
Collaborator

@xiaohui-sun xiaohui-sun commented Feb 11, 2025

Summary

There is a NPE when fetching a non-exist key from a GroupBy w/ derivation like below:

2025-02-11 18:07:04 ERROR Fetcher:192 - Exception Message: scala.MatchError: (Map(id_host -> 12345),null) (of class scala.Tuple2)
	at ai.chronon.online.OnlineDerivationUtil$.$anonfun$buildRenameOnlyDerivationFunction$1(OnlineDerivationUtil.scala:32)
	at ai.chronon.online.FetcherBase.$anonfun$fetchGroupBys$25(FetcherBase.scala:514)
	at scala.util.Try$.apply(Try.scala:210)
	at ai.chronon.online.FetcherBase.$anonfun$fetchGroupBys$18(FetcherBase.scala:516)
	at scala.util.Success.map(Try.scala:262)
	at ai.chronon.online.FetcherBase.$anonfun$fetchGroupBys$17(FetcherBase.scala:449)
	at scala.collection.Iterator$$anon$9.next(Iterator.scala:575)
	at scala.collection.immutable.List.prependedAll(List.scala:153)
	at scala.collection.IterableOnceOps.toList(IterableOnce.scala:1251)
	at scala.collection.IterableOnceOps.toList$(IterableOnce.scala:1251)
	at scala.collection.AbstractIterator.toList(Iterator.scala:1288)
	at ai.chronon.online.FetcherBase.$anonfun$fetchGroupBys$9(FetcherBase.scala:447)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

This PR fixes it by returning null values for derivations if key is not found.

Why / Goal

Test Plan

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested

Checklist

  • Documentation update

Reviewers

@hzding621 @yuli-han

@xiaohui-sun xiaohui-sun marked this pull request as ready for review February 12, 2025 00:52
@xiaohui-sun xiaohui-sun changed the title [WIP] Fix NPE when fetching a non-exist key from a GroupBy w/ derivation Fix NPE when fetching a non-exist key from a GroupBy w/ derivation Feb 12, 2025
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.

2 participants