You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/03/30 05:41:34 UTC
[GitHub] [incubator-pinot] fx19880617 commented on a change in pull request
#4041: Use hex string as the representation of byte array for queries
fx19880617 commented on a change in pull request #4041: Use hex string as the representation of byte array for queries
URL: https://github.com/apache/incubator-pinot/pull/4041#discussion_r270614155
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/dictionary/BytesOnHeapMutableDictionary.java
##########
@@ -20,20 +20,29 @@
import java.util.Arrays;
import javax.annotation.Nonnull;
+import javax.xml.bind.DatatypeConverter;
import org.apache.pinot.common.utils.primitive.ByteArray;
/**
* OnHeap mutable dictionary of Bytes type.
*/
public class BytesOnHeapMutableDictionary extends BaseOnHeapMutableDictionary {
+
private ByteArray _min = null;
private ByteArray _max = null;
@Override
public int indexOf(Object rawValue) {
assert rawValue instanceof byte[];
- return getDictId(new ByteArray((byte[]) rawValue));
+ byte[] bytes;
+ // Convert hex string to byte[].
+ if (rawValue instanceof String) {
+ bytes = DatatypeConverter.parseHexBinary((String) rawValue);
Review comment:
sounds good, updated with org.apache.commons.codec.binary.Hex api.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org