This repository was archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Update Algorithm.java #4
Open
felipexw
wants to merge
1
commit into
apache:master
Choose a base branch
from
felipexw:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solved bug "empty collection".
Thanks @felipexw. Can you point this are the Apache version of PIO here: https://github.com/apache/incubator-predictionio Create the PR against the Future releases will come through Apache. A little more explanation of error conditions solved would be great. |
On querying for recommendation for a user (u6), I got the following error as a response: Query:
{ "userEntityId":
"u6", "number": 4 }
Stack Trace:
java.lang.RuntimeException: empty collection
at org.example.recommendation.Algorithm.getRecentProductFeatures(Algorithm.java:256)
at org.example.recommendation.Algorithm.predict(Algorithm.java:186)
at org.example.recommendation.Algorithm.predict(Algorithm.java:35)
at org.apache.predictionio.controller.PAlgorithm.predictBase(PAlgorithm.scala:76)
at org.apache.predictionio.workflow.ServerActor$$anonfun$24$$anonfun$25.apply(CreateServer.scala:490)
at org.apache.predictionio.workflow.ServerActor$$anonfun$24$$anonfun$25.apply(CreateServer.scala:489)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.immutable.List.map(List.scala:285)
at org.apache.predictionio.workflow.ServerActor$$anonfun$24.apply(CreateServer.scala:489)
at org.apache.predictionio.workflow.ServerActor$$anonfun$24.apply(CreateServer.scala:467)
at spray.routing.ApplyConverterInstances$$anon$22$$anonfun$apply$1.apply(ApplyConverterInstances.scala:25)
at spray.routing.ApplyConverterInstances$$anon$22$$anonfun$apply$1.apply(ApplyConverterInstances.scala:24)
at spray.routing.ConjunctionMagnet$$anon$1$$anon$2$$anonfun$happly$1$$anonfun$apply$1.apply(Directive.scala:38)
at spray.routing.ConjunctionMagnet$$anon$1$$anon$2$$anonfun$happly$1$$anonfun$apply$1.apply(Directive.scala:37)
at spray.routing.directives.BasicDirectives$$anon$1.happly(BasicDirectives.scala:26)
at spray.routing.ConjunctionMagnet$$anon$1$$anon$2$$anonfun$happly$1.apply(Directive.scala:37)
at spray.routing.ConjunctionMagnet$$anon$1$$anon$2$$anonfun$happly$1.apply(Directive.scala:36)
at spray.routing.directives.BasicDirectives$$anon$2.happly(BasicDirectives.scala:79)
at spray.routing.Directive$$anon$7$$anonfun$happly$4.apply(Directive.scala:86)
at spray.routing.Directive$$anon$7$$anonfun$happly$4.apply(Directive.scala:86)
at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
at spray.routing.directives.BasicDirectives$$anon$3$$anonfun$happly$1.apply(BasicDirectives.scala:92)
at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$1.apply$mcV$sp(ExecutionDirectives.scala:89)
at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$1.apply(ExecutionDirectives.scala:89)
at spray.routing.directives.ExecutionDirectives$$anonfun$detach$1$$anonfun$apply$7$$anonfun$apply$1.apply(ExecutionDirectives.scala:89)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.UnsupportedOperationException: empty collection
at org.apache.spark.rdd.RDD$$anonfun$first$1.apply(RDD.scala:1370)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
at org.apache.spark.rdd.RDD.withScope(RDD.scala:362)
at org.apache.spark.rdd.RDD.first(RDD.scala:1367)
at org.apache.spark.api.java.JavaPairRDD.first(JavaPairRDD.scala:221)
at org.example.recommendation.Algorithm.getRecentProductFeatures(Algorithm.java:234)
... 34 more @felipexw Is this issue addressed in this PR? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved bug "empty collection".