public static INormalizedKeyComputerFactory variablesToAscNormalizedKeyComputerFactory( Collection<LogicalVariable> varLogical, IVariableTypeEnvironment env, JobGenContext context) throws AlgebricksException { INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); if (nkcfProvider == null) return null; for (LogicalVariable v : varLogical) { Object type = env.getVarType(v); return nkcfProvider.getNormalizedKeyComputerFactory(type, true); } return null; }
IBinaryComparatorFactory[] comparatorFactories = new IBinaryComparatorFactory[n]; INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null;
@Override public Pair<IConnectorDescriptor, TargetConstraint> createConnectorDescriptor(IConnectorDescriptorRegistry spec, ILogicalOperator op, IOperatorSchema opSchema, JobGenContext context) throws AlgebricksException { int n = partitioningFields.size(); int[] sortFields = new int[n]; IBinaryComparatorFactory[] comps = new IBinaryComparatorFactory[n]; INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null; IVariableTypeEnvironment env = context.getTypeEnvironment(op); int i = 0; for (OrderColumn oc : partitioningFields) { LogicalVariable var = oc.getColumn(); sortFields[i] = opSchema.findVariable(var); Object type = env.getVarType(var); OrderKind order = oc.getOrder(); if (i == 0 && nkcfProvider != null && type != null) { nkcf = nkcfProvider.getNormalizedKeyComputerFactory(type, order == OrderKind.ASC); } IBinaryComparatorFactoryProvider bcfp = context.getBinaryComparatorFactoryProvider(); comps[i] = bcfp.getBinaryComparatorFactory(type, oc.getOrder() == OrderKind.ASC); i++; } ITuplePartitionComputerFactory tpcf = new StaticFieldRangePartitionComputerFactory(sortFields, comps, rangeMap); IConnectorDescriptor conn = new MToNPartitioningMergingConnectorDescriptor(spec, tpcf, sortFields, comps, nkcf); return new Pair<IConnectorDescriptor, TargetConstraint>(conn, null); }
IBinaryComparatorFactory[] comps = new IBinaryComparatorFactory[n]; int i = 0; INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null; IVariableTypeEnvironment env = context.getTypeEnvironment(op);
logicalOp.getCompareVariables(0), context.getTypeEnvironment(op), context); INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null;
INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); if (nkcfProvider == null) { normalizedKeyFactory = null;
@Override public Pair<IConnectorDescriptor, TargetConstraint> createConnectorDescriptor(IConnectorDescriptorRegistry spec, ILogicalOperator op, IOperatorSchema opSchema, JobGenContext context) throws AlgebricksException { int n = sortColumns.length; int[] sortFields = new int[n]; IBinaryComparatorFactory[] comps = new IBinaryComparatorFactory[n]; IBinaryHashFunctionFactory[] hashFuns = new IBinaryHashFunctionFactory[n]; IVariableTypeEnvironment env = context.getTypeEnvironment(op); INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null; for (int i = 0; i < n; i++) { sortFields[i] = opSchema.findVariable(sortColumns[i].getColumn()); Object type = env.getVarType(sortColumns[i].getColumn()); IBinaryComparatorFactoryProvider bcfp = context.getBinaryComparatorFactoryProvider(); comps[i] = bcfp.getBinaryComparatorFactory(type, sortColumns[i].getOrder() == OrderKind.ASC); IBinaryHashFunctionFactoryProvider bhffp = context.getBinaryHashFunctionFactoryProvider(); hashFuns[i] = bhffp.getBinaryHashFunctionFactory(type); if (i == 0 && nkcfProvider != null && type != null) { nkcf = nkcfProvider.getNormalizedKeyComputerFactory(type, sortColumns[i].getOrder() == OrderKind.ASC); } } ITuplePartitionComputerFactory tpcf = new FieldHashPartitionComputerFactory(sortFields, hashFuns); IConnectorDescriptor conn = new MToNPartitioningMergingConnectorDescriptor(spec, tpcf, sortFields, comps, nkcf); return new Pair<IConnectorDescriptor, TargetConstraint>(conn, TargetConstraint.ONE); }
IBinaryComparatorFactory[] comps = new IBinaryComparatorFactory[n]; INormalizedKeyComputerFactoryProvider nkcfProvider = context.getNormalizedKeyComputerFactoryProvider(); INormalizedKeyComputerFactory nkcf = null;