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 2020/03/05 19:37:01 UTC

[GitHub] [incubator-pinot] mcvsubbu commented on a change in pull request #5115: Refactor the data source to include all information needed for query execution

mcvsubbu commented on a change in pull request #5115: Refactor the data source to include all information needed for query execution
URL: https://github.com/apache/incubator-pinot/pull/5115#discussion_r388502899
 
 

 ##########
 File path: pinot-core/src/main/java/org/apache/pinot/core/common/DataSourceMetadata.java
 ##########
 @@ -18,24 +18,79 @@
  */
 package org.apache.pinot.core.common;
 
-import org.apache.pinot.spi.data.FieldSpec.DataType;
+import java.util.Set;
+import javax.annotation.Nullable;
+import org.apache.pinot.core.data.partition.PartitionFunction;
+import org.apache.pinot.spi.data.FieldSpec;
 
 
+/**
+ * The {@code DataSourceMetadata} class contains all the metadata for a column for query execution purpose.
+ */
 public interface DataSourceMetadata {
 
-  DataType getDataType();
+  /**
+   * Returns the field spec of the column.
+   */
+  FieldSpec getFieldSpec();
+
+  /**
+   * Returns the data type of the column.
+   */
+  default FieldSpec.DataType getDataType() {
+    return getFieldSpec().getDataType();
+  }
 
-  boolean isSingleValue();
+  /**
+   * Returns {@code true} if the column is single-valued, {@code false} otherwise.
+   */
+  default boolean isSingleValue() {
+    return getFieldSpec().isSingleValueField();
+  }
 
+  /**
+   * Returns {@code true} if the column is sorted, {@code false} otherwise.
+   */
   boolean isSorted();
 
+  /**
+   * Returns the number of documents of the column.
+   */
   int getNumDocs();
 
-  int getMaxNumMultiValues();
+  /**
+   * Returns the number of values of the column. For single-value column, number of values always equals to number of
+   * documents; for multi-value column, each document (multi-value entry) may contain multiple values.
+   */
+  int getNumValues();
+
+  /**
+   * Returns the maximum number of values for each multi-value entry of the multi-value column. For single-value column,
+   * the value is undefined.
 
 Review comment:
   might as well throw exception instead of returning an undefined value and getting an undefined behavior?

----------------------------------------------------------------
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