-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Extend StringAppendTESTOperator to use string delimiter of variable length #4806
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,15 @@ public StringAppendOperator() { | |
this(','); | ||
} | ||
|
||
public StringAppendOperator(char delim) { | ||
public StringAppendOperator(final char delim) { | ||
super(newSharedStringAppendOperator(delim)); | ||
} | ||
|
||
public StringAppendOperator(final byte[] delim) { | ||
super(newSharedStringAppendTESTOperator(delim)); | ||
} | ||
|
||
private native static long newSharedStringAppendOperator(final char delim); | ||
private native static long newSharedStringAppendTESTOperator(final byte[] delim); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this named with "TEST" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be something to discuss. I tried not to change too much in general. As I understand there are 2 string appending merge operators in c++ at the moment: I thought about creating another separate Java |
||
@Override protected final native void disposeInternal(final long handle); | ||
} |
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.
It seems a bad idea that, depending on the constructor argument, a different implementation of the string append opertor is used. I wonder if instead it would be better to either i) have a different class in the java API that alwys goes against
StringAppendTESTOperator
or ii) replaceSharedStringAppendOperator
withSharedStringAppendTESTOperator
in all places here. Is there any scenario where a user would preferSharedStringAppendOperator
overSharedStringAppendTESTOperator
?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.
True, while implementing this, I was not sure about all implications for the API.
ii) I do not know exact name origin and all backwards compatibility implications of using only
SharedStringAppendTESTOperator
, but it seems to me that it is more performant and it uses newer c++ merge interface, maybe @sagar0 could help to answer this question.if ii) is not applicable, i) is what I suggested in the upper comment to add a separate java class
StringAppendOperatorWithVariableDelimitor
which usesSharedStringAppendTESTOperator
if this looks ok for the APIThere 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.
I think for the time being this approach is okay.
StringAppendOperator
implements the Associative Merge OperatorStringAppendTESTOperator
implements the Non-Associative Merge Operator API