use of org.apache.hyracks.algebricks.common.exceptions.NotImplementedException in project asterixdb by apache.
the class RangeMapBuilder method parseLiteralToBytes.
@SuppressWarnings("unchecked")
private static void parseLiteralToBytes(Expression item, DataOutput out) throws CompilationException {
AMutableDouble aDouble = new AMutableDouble(0);
AMutableFloat aFloat = new AMutableFloat(0);
AMutableInt64 aInt64 = new AMutableInt64(0);
AMutableInt32 aInt32 = new AMutableInt32(0);
AMutableString aString = new AMutableString("");
@SuppressWarnings("rawtypes") ISerializerDeserializer serde;
Literal l = ((LiteralExpr) item).getValue();
try {
switch(l.getLiteralType()) {
case DOUBLE:
DoubleLiteral dl = (DoubleLiteral) l;
serde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ADOUBLE);
aDouble.setValue(dl.getValue());
serde.serialize(aDouble, out);
break;
case FLOAT:
FloatLiteral fl = (FloatLiteral) l;
serde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AFLOAT);
aFloat.setValue(fl.getValue());
serde.serialize(aFloat, out);
break;
case INTEGER:
IntegerLiteral il = (IntegerLiteral) l;
serde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT32);
aInt32.setValue(il.getValue());
serde.serialize(aInt32, out);
break;
case LONG:
LongIntegerLiteral lil = (LongIntegerLiteral) l;
serde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AINT64);
aInt64.setValue(lil.getValue());
serde.serialize(aInt64, out);
break;
case STRING:
StringLiteral sl = (StringLiteral) l;
serde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ASTRING);
aString.setValue(sl.getValue());
serde.serialize(aString, out);
break;
default:
throw new NotImplementedException("The range map builder has not been implemented for " + item.getKind() + " type of expressions.");
}
} catch (HyracksDataException e) {
throw new CompilationException(e.getMessage());
}
}
use of org.apache.hyracks.algebricks.common.exceptions.NotImplementedException in project asterixdb by apache.
the class AObjectSerializerDeserializer method serialize.
@Override
public void serialize(IAObject instance, DataOutput out) throws HyracksDataException {
IAType t = instance.getType();
ATypeTag tag = t.getTypeTag();
try {
out.writeByte(tag.serialize());
} catch (IOException e) {
throw new HyracksDataException(e);
}
switch(tag) {
case MISSING:
AMissingSerializerDeserializer.INSTANCE.serialize((AMissing) instance, out);
break;
case NULL:
ANullSerializerDeserializer.INSTANCE.serialize(instance, out);
break;
case BOOLEAN:
ABooleanSerializerDeserializer.INSTANCE.serialize((ABoolean) instance, out);
break;
case TINYINT:
AInt8SerializerDeserializer.INSTANCE.serialize((AInt8) instance, out);
break;
case SMALLINT:
AInt16SerializerDeserializer.INSTANCE.serialize((AInt16) instance, out);
break;
case INTEGER:
AInt32SerializerDeserializer.INSTANCE.serialize((AInt32) instance, out);
break;
case BIGINT:
AInt64SerializerDeserializer.INSTANCE.serialize((AInt64) instance, out);
break;
case FLOAT:
AFloatSerializerDeserializer.INSTANCE.serialize((AFloat) instance, out);
break;
case DOUBLE:
ADoubleSerializerDeserializer.INSTANCE.serialize((ADouble) instance, out);
break;
case STRING:
AStringSerializerDeserializer.INSTANCE.serialize((AString) instance, out);
break;
case BINARY:
ABinarySerializerDeserializer.INSTANCE.serialize((ABinary) instance, out);
break;
case DATE:
ADateSerializerDeserializer.INSTANCE.serialize((ADate) instance, out);
break;
case TIME:
ATimeSerializerDeserializer.INSTANCE.serialize((ATime) instance, out);
break;
case DATETIME:
ADateTimeSerializerDeserializer.INSTANCE.serialize((ADateTime) instance, out);
break;
case DURATION:
ADurationSerializerDeserializer.INSTANCE.serialize((ADuration) instance, out);
break;
case INTERVAL:
AIntervalSerializerDeserializer.INSTANCE.serialize((AInterval) instance, out);
break;
case POINT:
APointSerializerDeserializer.INSTANCE.serialize((APoint) instance, out);
break;
case POINT3D:
APoint3DSerializerDeserializer.INSTANCE.serialize((APoint3D) instance, out);
break;
case LINE:
ALineSerializerDeserializer.INSTANCE.serialize((ALine) instance, out);
break;
case RECTANGLE:
ARectangleSerializerDeserializer.INSTANCE.serialize((ARectangle) instance, out);
break;
case POLYGON:
APolygonSerializerDeserializer.INSTANCE.serialize((APolygon) instance, out);
break;
case CIRCLE:
ACircleSerializerDeserializer.INSTANCE.serialize((ACircle) instance, out);
break;
case OBJECT:
ARecordSerializerDeserializer.SCHEMALESS_INSTANCE.serialize((ARecord) instance, out);
break;
case ARRAY:
AOrderedListSerializerDeserializer.SCHEMALESS_INSTANCE.serialize((AOrderedList) instance, out);
break;
case MULTISET:
AUnorderedListSerializerDeserializer.SCHEMALESS_INSTANCE.serialize((AUnorderedList) instance, out);
break;
case TYPE:
ATypeSerializerDeserializer.INSTANCE.serialize((IAType) instance, out);
break;
default:
throw new NotImplementedException("No serializer/deserializer implemented for type " + t.getTypeTag() + " .");
}
}
use of org.apache.hyracks.algebricks.common.exceptions.NotImplementedException in project asterixdb by apache.
the class JoinMultiComparator method generateOptimizedHashJoinRuntime.
private IOperatorDescriptor generateOptimizedHashJoinRuntime(JobGenContext context, IOperatorSchema[] inputSchemas, int[] keysLeft, int[] keysRight, IBinaryHashFunctionFamily[] hashFunFamilies, IBinaryComparatorFactory[] comparatorFactories, IPredicateEvaluatorFactory predEvaluatorFactory, RecordDescriptor recDescriptor, IOperatorDescriptorRegistry spec) throws AlgebricksException {
IOperatorDescriptor opDesc;
try {
switch(kind) {
case INNER:
opDesc = new OptimizedHybridHashJoinOperatorDescriptor(spec, getMemSizeInFrames(), maxInputBuildSizeInFrames, getFudgeFactor(), keysLeft, keysRight, hashFunFamilies, comparatorFactories, recDescriptor, new JoinMultiComparatorFactory(comparatorFactories, keysLeft, keysRight), new JoinMultiComparatorFactory(comparatorFactories, keysRight, keysLeft), predEvaluatorFactory);
break;
case LEFT_OUTER:
IMissingWriterFactory[] nonMatchWriterFactories = new IMissingWriterFactory[inputSchemas[1].getSize()];
for (int j = 0; j < nonMatchWriterFactories.length; j++) {
nonMatchWriterFactories[j] = context.getMissingWriterFactory();
}
opDesc = new OptimizedHybridHashJoinOperatorDescriptor(spec, getMemSizeInFrames(), maxInputBuildSizeInFrames, getFudgeFactor(), keysLeft, keysRight, hashFunFamilies, comparatorFactories, recDescriptor, new JoinMultiComparatorFactory(comparatorFactories, keysLeft, keysRight), new JoinMultiComparatorFactory(comparatorFactories, keysRight, keysLeft), predEvaluatorFactory, true, nonMatchWriterFactories);
break;
default:
throw new NotImplementedException();
}
} catch (HyracksDataException e) {
throw new AlgebricksException(e);
}
return opDesc;
}
use of org.apache.hyracks.algebricks.common.exceptions.NotImplementedException in project asterixdb by apache.
the class DistributeResultPOperator method contributeRuntimeOperator.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) throws AlgebricksException {
DistributeResultOperator resultOp = (DistributeResultOperator) op;
IMetadataProvider mp = context.getMetadataProvider();
JobSpecification spec = builder.getJobSpec();
int[] columns = new int[resultOp.getExpressions().size()];
int i = 0;
for (Mutable<ILogicalExpression> exprRef : resultOp.getExpressions()) {
ILogicalExpression expr = exprRef.getValue();
if (expr.getExpressionTag() != LogicalExpressionTag.VARIABLE) {
throw new NotImplementedException("Only writing variable expressions is supported.");
}
VariableReferenceExpression varRef = (VariableReferenceExpression) expr;
LogicalVariable v = varRef.getVariableReference();
columns[i++] = inputSchemas[0].findVariable(v);
}
RecordDescriptor inputDesc = JobGenHelper.mkRecordDescriptor(context.getTypeEnvironment(op.getInputs().get(0).getValue()), inputSchemas[0], context);
IPrinterFactory[] pf = JobGenHelper.mkPrinterFactories(inputSchemas[0], context.getTypeEnvironment(op), context, columns);
Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> runtimeAndConstraints = mp.getResultHandleRuntime(resultOp.getDataSink(), columns, pf, inputDesc, true, spec);
builder.contributeHyracksOperator(resultOp, runtimeAndConstraints.first);
ILogicalOperator src = resultOp.getInputs().get(0).getValue();
builder.contributeGraphEdge(src, 0, resultOp, 0);
}
use of org.apache.hyracks.algebricks.common.exceptions.NotImplementedException in project asterixdb by apache.
the class NestedLoopJoinPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator iop, IOptimizationContext context) {
if (partitioningType != JoinPartitioningType.BROADCAST) {
throw new NotImplementedException(partitioningType + " nested loop joins are not implemented.");
}
IPartitioningProperty pp;
AbstractLogicalOperator op = (AbstractLogicalOperator) iop;
if (op.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.PARTITIONED) {
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op.getInputs().get(1).getValue();
IPhysicalPropertiesVector pv1 = op2.getPhysicalOperator().getDeliveredProperties();
if (pv1 == null) {
pp = null;
} else {
pp = pv1.getPartitioningProperty();
}
} else {
pp = IPartitioningProperty.UNPARTITIONED;
}
// Nested loop join cannot maintain the local structure property for the probe side
// because of the I/O optimization for the build branch.
this.deliveredProperties = new StructuralPropertiesVector(pp, null);
}
Aggregations