-
Notifications
You must be signed in to change notification settings - Fork 115
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
NPE from accumulator #498
Comments
Tried acc/min and acc/max and those don't give NPE. acc/sum and acc/average do. |
here's the sum function:
Maybe the total is null? how could this be? |
I don't believe that to be a possibility, as we should always be starting at zero and applying increments and decrements based on the direction(insert/retract) of the facts.
That seems to be somewhat odd, min/max handle the initial value being For the |
@EthanEChristian it's a POJO. |
@victorrodrigueznadq, (= ?exchangeSymbol symbol)
(= ?acctVolume totalVolume)
(= ?acctIdentifier accountIdentifier)
(= ?firmIdentifier firmIdentifier) The same doesn't apply to accumulators that have field accessors, so i believe that the application of the keyword accessor( While not as pretty, i believe that the NPE can be avoided by creating an accessor on the fly for the POJO in question, something like: [?sumTotalVolume <-(acc/sum #(.getTotalVolume %)) :from [VolumeAccumulation
(= accumulationLevel VolumeAccumulation$AccumulationLevel/EXCHANGE_SYMBOL)
(= accumulationCode "nqeAddDlp")
(= symbol ?exchangeSymbol)
]] As to:
The only thing i can conclude would possibly be that there only ever exists one matching |
@EthanEChristian that worked. thanks! is there a plan to add the missing "sugar?" |
@victorrodrigueznadq I will certainly log an issue to investigate the possibility of adding that support, as it feels like a pretty easy gotcha to bump into. That being said, i'm not sure of how i'd tackle it in the current implementation but it certainly feels like something that should be mulled over. I will post back with the issue number in a bit. |
@victorrodrigueznadq |
thanks @EthanEChristian good luck! |
This is the LHS of my rule:
I'm getting the following NPE from the acc/sum:
I've ensured that totalVolume is never null, even by hardcoding the getter to always return 100L. Still get the same error:
I'm stumped. Any suggestions?
The text was updated successfully, but these errors were encountered: