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/10/04 17:41:46 UTC
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull
request #4671: Make GenericRow support null value fields and default null
values
Jackie-Jiang commented on a change in pull request #4671: Make GenericRow support null value fields and default null values
URL: https://github.com/apache/incubator-pinot/pull/4671#discussion_r331612990
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/GenericRow.java
##########
@@ -18,85 +18,148 @@
*/
package org.apache.pinot.core.data;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import org.apache.pinot.common.data.RowEvent;
+import javax.annotation.Nullable;
+import org.apache.pinot.common.utils.EqualityUtils;
import org.apache.pinot.common.utils.JsonUtils;
+import org.apache.pinot.core.data.readers.RecordReader;
+import org.apache.pinot.core.data.recordtransformer.NullValueTransformer;
+import org.apache.pinot.core.data.recordtransformer.RecordTransformer;
/**
- * A plain implementation of RowEvent based on HashMap. Should be reused as much as possible via
- * {@link GenericRow#createOrReuseRow(GenericRow)}
+ * The generic row is the value holder returned from {@link RecordReader#next()} and
+ * {@link RecordReader#next(GenericRow)}, and can be modified with {@link RecordTransformer}. The generic row returned
+ * from the {@link NullValueTransformer} should have {@code defaultNullValue} filled to the fields with {@code null}
+ * value, so that for fields with {@code null} value, {@link #getValue(String)} will return the {@code defaultNullValue}
+ * and {@link #isNullValue(String)} will return {@code true}.
*/
-public class GenericRow implements RowEvent {
- private Map<String, Object> _fieldMap = new HashMap<>();
+public class GenericRow {
+ private final Map<String, Object> _fieldToValueMap = new Object2ObjectOpenHashMap<>();
Review comment:
Make sense. Fastutil map is faster, but maybe not necessary. Will replace with java map.
----------------------------------------------------------------
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