drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serhii-Harnyk <...@git.apache.org>
Subject [GitHub] drill pull request #793: DRILL-4678: Tune metadata by generating a dispatche...
Date Thu, 23 Mar 2017 11:43:51 GMT
Github user Serhii-Harnyk commented on a diff in the pull request:

    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java
    @@ -14,35 +14,71 @@
      * 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.drill.exec.planner.cost;
    +import org.apache.calcite.rel.SingleRel;
     import org.apache.calcite.rel.core.Aggregate;
     import org.apache.calcite.rel.core.Filter;
    +import org.apache.calcite.rel.core.Join;
    +import org.apache.calcite.rel.core.Project;
    +import org.apache.calcite.rel.core.Sort;
    +import org.apache.calcite.rel.core.Union;
     import org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider;
     import org.apache.calcite.rel.metadata.RelMdRowCount;
     import org.apache.calcite.rel.metadata.RelMetadataProvider;
    +import org.apache.calcite.rel.metadata.RelMetadataQuery;
     import org.apache.calcite.util.BuiltInMethod;
     import org.apache.calcite.util.ImmutableBitSet;
    +import org.apache.drill.exec.planner.common.DrillLimitRelBase;
     public class DrillRelMdRowCount extends RelMdRowCount{
       private static final DrillRelMdRowCount INSTANCE = new DrillRelMdRowCount();
       public static final RelMetadataProvider SOURCE = ReflectiveRelMetadataProvider.reflectiveSource(BuiltInMethod.ROW_COUNT.method,
    -  public Double getRowCount(Aggregate rel) {
    +  public Double getRowCount(Aggregate rel, RelMetadataQuery mq) {
         ImmutableBitSet groupKey = ImmutableBitSet.range(rel.getGroupCount());
         if (groupKey.isEmpty()) {
           return 1.0;
         } else {
    -      return super.getRowCount(rel);
    +      return super.getRowCount(rel, mq);
    -  public Double getRowCount(Filter rel) {
    -    return rel.getRows();
    +  public Double getRowCount(Filter rel, RelMetadataQuery mq) {
    --- End diff --
    In RelMdRowCount.java added overloaded methods, which returns other result than getRowCount(RelNode
rel, RelMetadataQuery mq) [1] as it was before. 
    So in order to preserve previous Drill behavior, I override those methods.
    [1] https://github.com/Serhii-Harnyk/incubator-calcite/blob/02848c99d75f2d0e00c219f3fa300fc8e7df26df/core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java#L65

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message