Skip to content

Spark enrichment integration issues #101

Description

@Alex-Ikanow
  • inMapPartitions(Post|PrePost)Group fails if any of the partitions receive an empty iterator (fixed by this commit)
  • For some reason, the scala inMapPartitions(Post|PrePost)Group methods take java iterables as there input, meaning that it is necessary to insert an extra map stage after the groupBy call, looking something like .map { case (o, it) => (o. it.asScala)
    • (seems like it would be an easy fix to perform that map inside the inMapPartitons* code)
  • (UPDATE: SOLVED BUT NOT FIXED - SEE SECOND COMMENT BELOW) According to Yuri, the group key is not inserted into the onObjectBatch calls (looking at the unit tests, that is not tested)
    • Actually in latest reports, .inMapPartitionsPreGroup("key") generates empty keys (in the first element of the return 2-tuple)
  • Also reported by Yuri, and contradicting test code:
If I use groupBy ( get field) instead of groupByKey, it changes the type from 

Iterator[(com.ikanow.aleph2.data_model.interfaces.data_analytics.IBatchRecord,  Iterable[(Long, com.ikanow.aleph2.data_model.interfaces.data_analytics.IBatchRecord)])], that .inMapPartitionsPostGroup expects to
Iterator[(com.ikanow.aleph2.core.shared.utils.BatchRecordUtils.JsonBatchRecord, Iterable[(com.ikanow.aleph2.data_model.interfaces.data_analytics.IBatchRecord, (Long, com.ikanow.aleph2.data_model.interfaces.data_analytics.IBatchRecord))])] 

It makes sense after I found an obscure reference in the doc: groupBy( func key) treats the source RDD as NOT-Paired. So it pairs it by adding that key. Which of course breaks .inMapPartitionsPostGroup 

See the linked test code, in JavaRDDs I have a groupBy immediately followed by inMapPartitionsPrePostGroup which has the same "input" type as inMapPartitionsPostGroup (code)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions