@Override public String visitDataScanOperator(DataSourceScanOperator op, Boolean showDetails) throws AlgebricksException { stringBuilder.setLength(0); stringBuilder.append("data-scan ").append(op.getProjectVariables()).append("<-").append(op.getVariables()) .append(" <- ").append(op.getDataSource()); appendFilterInformation(op.getMinFilterVars(), op.getMaxFilterVars()); appendSelectConditionInformation(op.getSelectCondition()); appendLimitInformation(op.getOutputLimit()); appendSchema(op, showDetails); appendAnnotations(op, showDetails); appendPhysicalOperatorInfo(op, showDetails); return stringBuilder.toString(); }
@Override public ILogicalOperator visitDataScanOperator(DataSourceScanOperator op, Void arg) throws AlgebricksException { ArrayList<LogicalVariable> newInputList = new ArrayList<>(); newInputList.addAll(op.getVariables()); Mutable<ILogicalExpression> newSelectCondition = op.getSelectCondition() != null ? deepCopyExpressionRef(op.getSelectCondition()) : null; DataSourceScanOperator newOp = new DataSourceScanOperator(newInputList, op.getDataSource(), newSelectCondition, op.getOutputLimit()); return newOp; }
private boolean isScanPushable(DataSourceScanOperator op, Set<LogicalVariable> selectedVariables) { if (op.getOutputLimit() >= 0) { return false; } if (!op.getInputs().isEmpty() && op.getInputs().get(0).getValue().getOperatorTag() != LogicalOperatorTag.EMPTYTUPLESOURCE) { return false; } if (((DataSource) op.getDataSource()).getDatasourceType() != DataSource.Type.INTERNAL_DATASET) { return false; } if (!op.getScanVariables().containsAll(selectedVariables)) { return false; } return true; }
@Override public Void visitDataScanOperator(DataSourceScanOperator op, Integer indent) throws AlgebricksException { AlgebricksAppendable plan = addIndent(indent).append( "data-scan " + op.getProjectVariables() + "<-" + op.getVariables() + " <- " + op.getDataSource()); appendFilterInformation(plan, op.getMinFilterVars(), op.getMaxFilterVars()); appendSelectConditionInformation(plan, op.getSelectCondition(), indent); appendLimitInformation(plan, op.getOutputLimit()); return null; }
@Override public ILogicalOperator visitDataScanOperator(DataSourceScanOperator op, ILogicalOperator arg) throws AlgebricksException { Mutable<ILogicalExpression> newSelectCondition = op.getSelectCondition() != null ? exprDeepCopyVisitor.deepCopyExpressionReference(op.getSelectCondition()) : null; DataSourceScanOperator opCopy = new DataSourceScanOperator(deepCopyVariableList(op.getVariables()), op.getDataSource(), newSelectCondition, op.getOutputLimit()); deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy); return opCopy; }
@Override public Void visitDataScanOperator(DataSourceScanOperator op, Integer indent) throws AlgebricksException { AlgebricksAppendable plan = addIndent(indent).append("\"operator\": \"data-scan\""); if (!op.getProjectVariables().isEmpty()) { addIndent(0).append(",\n"); addIndent(indent).append("\"project-variables\": ["); appendVars(op.getProjectVariables()); buffer.append("]"); } variablePrintHelper(op.getVariables(), indent); if (op.getDataSource() != null) { addIndent(0).append(",\n"); addIndent(indent).append("\"data-source\": \"" + op.getDataSource() + "\""); } appendFilterInformation(plan, op.getMinFilterVars(), op.getMaxFilterVars(), indent); appendSelectConditionInformation(plan, op.getSelectCondition(), indent); appendLimitInformation(plan, op.getOutputLimit(), indent); return null; }
scan.getOutputLimit(), opSchema, typeEnv, context, builder.getJobSpec(), implConfig); IOperatorDescriptor opDesc = p.first; opDesc.setSourceLocation(scan.getSourceLocation());