@Override public Void visitDataScanOperator(DataSourceScanOperator op, Void arg) throws AlgebricksException { producedVariables.addAll(op.getVariables()); return null; }
@Override public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) { // partitioning properties DataSourceScanOperator dssOp = (DataSourceScanOperator) op; IDataSourcePropertiesProvider dspp = dataSource.getPropertiesProvider(); deliveredProperties = dspp.computePropertiesVector(dssOp.getVariables()); }
private void fillPKVars(DataSourceScanOperator dataScan, List<LogicalVariable> pkVars) { pkVars.clear(); DatasetDataSource datasetDataSource = (DatasetDataSource) dataScan.getDataSource(); pkVars.clear(); if (datasetDataSource.getDataset().getDatasetDetails() instanceof InternalDatasetDetails) { int numPKs = datasetDataSource.getDataset().getPrimaryKeys().size(); for (int i = 0; i < numPKs; i++) { pkVars.add(dataScan.getVariables().get(i)); } } }
@Override public Boolean visitDataScanOperator(DataSourceScanOperator op, ILogicalOperator arg) throws AlgebricksException { AbstractLogicalOperator aop = (AbstractLogicalOperator) arg; if (aop.getOperatorTag() != LogicalOperatorTag.DATASOURCESCAN) { return Boolean.FALSE; } DataSourceScanOperator argScan = (DataSourceScanOperator) arg; if (!argScan.getDataSource().toString().equals(op.getDataSource().toString())) { return Boolean.FALSE; } DataSourceScanOperator scanOpArg = (DataSourceScanOperator) copyAndSubstituteVar(op, arg); boolean isomorphic = VariableUtilities.varListEqualUnordered(op.getVariables(), scanOpArg.getVariables()) && op.getDataSource().toString().equals(scanOpArg.getDataSource().toString()); return isomorphic; }
@Override public Void visitDataScanOperator(DataSourceScanOperator op, Pair<LogicalVariable, LogicalVariable> pair) throws AlgebricksException { List<LogicalVariable> variables = op.getVariables(); for (int i = 0; i < variables.size(); i++) { if (variables.get(i) == pair.first) { variables.set(i, pair.second); return null; } } if (op.getSelectCondition() != null) { op.getSelectCondition().getValue().substituteVar(pair.first, pair.second); } substVarTypes(op, pair); return null; }
@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; }
@Override public Void visitDataScanOperator(DataSourceScanOperator op, Void arg) { if (op.getAdditionalFilteringExpressions() != null) { for (Mutable<ILogicalExpression> e : op.getAdditionalFilteringExpressions()) { e.getValue().getUsedVariables(usedVariables); } } if (op.getSelectCondition() != null) { Set<LogicalVariable> usedVariablesBySelect = new HashSet<>(); op.getSelectCondition().getValue().getUsedVariables(usedVariablesBySelect); usedVariablesBySelect.removeAll(op.getVariables()); usedVariables.addAll(usedVariablesBySelect); } return null; }
@Override public Void visitDataScanOperator(DataSourceScanOperator op, IOptimizationContext ctx) throws AlgebricksException { ILogicalOperator inp1 = op.getInputs().get(0).getValue(); Map<LogicalVariable, EquivalenceClass> eqClasses = getOrCreateEqClasses(op, ctx); Map<LogicalVariable, EquivalenceClass> propagatedEqClasses = getOrComputeEqClasses(inp1, ctx); eqClasses.putAll(propagatedEqClasses); ctx.putEquivalenceClassMap(op, eqClasses); List<FunctionalDependency> fds = new ArrayList<FunctionalDependency>(getOrComputeFDs(inp1, ctx)); ctx.putFDList(op, fds); op.getDataSource().computeFDs(op.getVariables(), fds); return null; }
int numPrimaryKeys = dataset.getPrimaryKeys().size(); for (int i = 0; i < numPrimaryKeys; i++) { target.add(dataSourceScan.getVariables().get(i));
@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; }
if (!usedVariables.contains(datascan.getVariables())) { datascan.getVariables().get(0)); AssignOperator noOp = new AssignOperator(unnest.getVariable(), varExp); noOp.getInputs().addAll(unnest.getInputs());
@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; }
DataSource dataSource = (DataSource) scanOp.getDataSource(); List<ILogicalExpressionReferenceTransformWithCondition> transformers = null; List<LogicalVariable> allVars = scanOp.getVariables(); LogicalVariable dataVar = dataSource.getDataRecordVariable(allVars); LogicalVariable metaVar = dataSource.getMetaVariable(allVars);
List<LogicalVariable> varList = scanOp.getVariables(); for (int varIndex = 0; varIndex < varList.size(); varIndex++) { LogicalVariable var = varList.get(varIndex);
LogicalVariable recVar = scan.getVariables().get(scan.getVariables().size() - 1); if (recVar != var) { return false;
@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; }
List<LogicalVariable> allVars = scan.getVariables(); LogicalVariable dataRecVarInScan = ((DataSource) dataSource).getDataRecordVariable(allVars); LogicalVariable metaRecVarInScan = ((DataSource) dataSource).getMetaVariable(allVars); return false; LogicalVariable keyVar = scan.getVariables().get(p); VariableReferenceExpression keyVarRef = new VariableReferenceExpression(keyVar); keyVarRef.setSourceLocation(targetRecVar.getSourceLocation());
} else if (grandparentOp.getOperatorTag() == LogicalOperatorTag.DATASOURCESCAN) { DataSourceScanOperator dssOp = (DataSourceScanOperator) grandparentOp; inputRecord = dssOp.getVariables().get(0); inputRecordSourceLoc = dssOp.getSourceLocation(); } else if (grandparentOp.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
IMetadataProvider mp = context.getMetadataProvider(); IVariableTypeEnvironment typeEnv = context.getTypeEnvironment(op); List<LogicalVariable> vars = scan.getVariables(); List<LogicalVariable> projectVars = scan.getProjectVariables();