Search in sources :

Example 1 with FragmentLeaf

use of org.apache.drill.exec.physical.base.FragmentLeaf in project drill by axbaretto.

the class PhysicalPlanReader method readFragmentLeaf.

@VisibleForTesting
public FragmentLeaf readFragmentLeaf(String json) throws JsonProcessingException, IOException {
    logger.debug("Attempting to read {}", json);
    PhysicalOperator op = operatorReader.readValue(json);
    if (op instanceof FragmentLeaf) {
        return (FragmentLeaf) op;
    } else {
        throw new UnsupportedOperationException(String.format("The provided json fragment is not a FragmentLeaf. The operator was %s.", op.getClass().getCanonicalName()));
    }
}
Also used : PhysicalOperator(org.apache.drill.exec.physical.base.PhysicalOperator) FragmentLeaf(org.apache.drill.exec.physical.base.FragmentLeaf) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with FragmentLeaf

use of org.apache.drill.exec.physical.base.FragmentLeaf in project drill by apache.

the class PhysicalPlanReader method readFragmentOperator.

public FragmentRoot readFragmentOperator(String json) throws JsonProcessingException, IOException {
    logger.debug("Attempting to read {}", json);
    PhysicalOperator op = operatorReader.readValue(json);
    if (op instanceof FragmentLeaf) {
        return (FragmentRoot) op;
    } else {
        throw new UnsupportedOperationException(String.format("The provided json fragment doesn't have a FragmentRoot as its root operator.  The operator was %s.", op.getClass().getCanonicalName()));
    }
}
Also used : PhysicalOperator(org.apache.drill.exec.physical.base.PhysicalOperator) FragmentLeaf(org.apache.drill.exec.physical.base.FragmentLeaf) FragmentRoot(org.apache.drill.exec.physical.base.FragmentRoot)

Example 3 with FragmentLeaf

use of org.apache.drill.exec.physical.base.FragmentLeaf in project drill by apache.

the class PhysicalPlanReader method readFragmentLeaf.

@VisibleForTesting
public FragmentLeaf readFragmentLeaf(String json) throws IOException {
    logger.debug("Attempting to read {}", json);
    PhysicalOperator op = operatorReader.readValue(json);
    if (op instanceof FragmentLeaf) {
        return (FragmentLeaf) op;
    } else {
        throw new UnsupportedOperationException(String.format("The provided json fragment is not a FragmentLeaf. " + "The operator was %s.", op.getClass().getCanonicalName()));
    }
}
Also used : PhysicalOperator(org.apache.drill.exec.physical.base.PhysicalOperator) FragmentLeaf(org.apache.drill.exec.physical.base.FragmentLeaf) VisibleForTesting(org.apache.drill.shaded.guava.com.google.common.annotations.VisibleForTesting)

Aggregations

FragmentLeaf (org.apache.drill.exec.physical.base.FragmentLeaf)3 PhysicalOperator (org.apache.drill.exec.physical.base.PhysicalOperator)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 FragmentRoot (org.apache.drill.exec.physical.base.FragmentRoot)1 VisibleForTesting (org.apache.drill.shaded.guava.com.google.common.annotations.VisibleForTesting)1