Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HERE the RHEEM CODE #11

Open
github-actions bot opened this issue Feb 25, 2022 · 0 comments
Open

HERE the RHEEM CODE #11

github-actions bot opened this issue Feb 25, 2022 · 0 comments
Labels

Comments

@github-actions
Copy link

HERE the RHEEM CODE

https://github.com/databloom-ai/incubator-wayang/blob/e772b416946086bd9e912d8dcd3b9cd7ac220064/wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/relation/node/WayangFilter.java#L42

/*
 * 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.wayang.api.sql.relation.node;

import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.core.Filter;
import org.apache.calcite.rex.RexNode;

import java.util.stream.Stream;

public class WayangFilter extends Filter implements WayangRel {

  public WayangFilter(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode condition) {
    super(cluster, traits, child, condition);
  }

  @Override
  public void implement(Implementor implementor) {
    implementor.visitChild(0, getInput());
    implementor.addStatement(getWayangFilterStatement(implementor));
  }

  private Stream<String> getWayangFilterStatement(Implementor implementor) {
    System.out.println(condition);
    //TODO HERE the RHEEM CODE
    return implementor.getStatements().filter(ele -> Integer.parseInt(ele) == 2);
  }

  @Override
  public Filter copy(RelTraitSet traitSet, RelNode input, RexNode condition) {
    return null;
  }

}

692452bf9cfae056ea9fce99cd2efd4414fefb39

@github-actions github-actions bot added the todo label Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants