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

added the SplitRecord processor #509

Merged
merged 2 commits into from
Oct 7, 2019

Conversation

FeizNouri
Copy link
Collaborator

No description provided.

Copy link
Member

@oalam oalam left a comment

Choose a reason for hiding this comment

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

you're almost done. please read the review to update your code.
the major issue I'm seeing is that scala version upgrade that we really should avoid

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.12.9</version>
Copy link
Member

Choose a reason for hiding this comment

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

do we really need to upgrade scala version here ?
when working with spark this kind of changes must be hardly motivated

final boolean keepParent = context.getPropertyValue(KEEP_PARENT_RECORD).asBoolean();
final boolean keepParentType = context.getPropertyValue(KEEP_PARENT_RECORD_TYPE).asBoolean();
final boolean keepParentTime = context.getPropertyValue(KEEP_PARENT_RECORD_TIME).asBoolean();
Collection<Record> oringinRecods = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

typo here

for (String field : fieldNames) {
if (record.hasField(field))
map.put(field, record.getField(field));
else throw new IllegalArgumentException("there is no field " + field);
Copy link
Member

Choose a reason for hiding this comment

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

should not throw an exception here, but log an error instead.
process() method shall never exit with an exception

if (keepParentType) {
recordType = record.getType();
} else {recordType = newRecordType;}
Record newRecord = new StandardRecord().setFields(map).setType(recordType).setTime(recordTime).setId(newRecordType);
Copy link
Member

Choose a reason for hiding this comment

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

record_id must not be the record_type ! use the GUID by default in StandardRecord

@oalam oalam merged commit 175f80f into Hurence:develop Oct 7, 2019
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