-
Notifications
You must be signed in to change notification settings - Fork 29
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
added the SplitRecord processor #509
Conversation
There was a problem hiding this 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> |
There was a problem hiding this comment.
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<>(); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
...rs/logisland-processor-common/src/main/java/com/hurence/logisland/processor/SplitRecord.java
Show resolved
Hide resolved
if (keepParentType) { | ||
recordType = record.getType(); | ||
} else {recordType = newRecordType;} | ||
Record newRecord = new StandardRecord().setFields(map).setType(recordType).setTime(recordTime).setId(newRecordType); |
There was a problem hiding this comment.
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
No description provided.