[
https://issues.apache.org/jira/browse/TAJO-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14170777#comment-14170777
]
ASF GitHub Bot commented on TAJO-1112:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/200#discussion_r18821241
--- Diff:
tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/EquiDepthHistogram.java
---
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tajo.catalog.statistics;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tajo.catalog.proto.CatalogProtos.HistogramProto;
+import org.apache.tajo.util.TUtil;
+
+public class EquiDepthHistogram extends Histogram {
+
+ public EquiDepthHistogram() {
+ super();
+ }
+
+ public EquiDepthHistogram(HistogramProto proto) {
+ super(proto);
+ }
+
+ @Override
+ public boolean construct(List<Double> samples) {
+ int numBuckets = samples.size() > DEFAULT_MAX_BUCKETS ?
DEFAULT_MAX_BUCKETS : samples.size();
+ return construct(samples, numBuckets);
+ }
+
+ /**
+ * An EquiDepth histogram is constructed by dividing the data points
into buckets of equal frequencies (as equal as
+ * possible).
+ *
+ * Note that, this function, which allows the specification of the
(maximum) number of buckets, should be called
+ * directly only in the unit tests. In non-test cases, the
construct(samples) version above should be used.
+ */
--- End diff --
To allow the function call only in unit tests, you can use the
@VisibleForTesting annotation.
> Implement histogram interface and a candidate histogram
> -------------------------------------------------------
>
> Key: TAJO-1112
> URL: https://issues.apache.org/jira/browse/TAJO-1112
> Project: Tajo
> Issue Type: Sub-task
> Reporter: Long Mvh
> Assignee: Long Mvh
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)