You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by bu...@apache.org on 2016/05/24 01:31:28 UTC
[10/22] incubator-asterixdb git commit: ASTERIXDB-1228: Add MISSING
into the data model.
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
index 31ceb9f..f95a441 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ADayTimeDuration;
import org.apache.asterix.om.base.AMutableDayTimeDuration;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
@@ -73,9 +72,6 @@ public class ADayTimeDurationConstructorDescriptor extends AbstractScalarFunctio
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ADayTimeDuration> dayTimeDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ADAYTIMEDURATION);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -96,8 +92,6 @@ public class ADayTimeDurationConstructorDescriptor extends AbstractScalarFunctio
aDayTimeDuration, ADurationParseOption.DAY_TIME);
dayTimeDurationSerde.serialize(aDayTimeDuration, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
index adacd51..92d7c72 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
@@ -25,7 +25,6 @@ import org.apache.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ADouble;
import org.apache.asterix.om.base.AMutableDouble;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -77,9 +76,6 @@ public class ADoubleConstructorDescriptor extends AbstractScalarFunctionDynamicD
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ADouble> doubleSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ADOUBLE);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@@ -107,8 +103,6 @@ public class ADoubleConstructorDescriptor extends AbstractScalarFunctionDynamicD
aDouble.setValue(Double.parseDouble(utf8Ptr.toString()));
}
doubleSerde.serialize(aDouble, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
index cd48249..18dc471 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ADuration;
import org.apache.asterix.om.base.AMutableDuration;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
@@ -70,9 +69,6 @@ public class ADurationConstructorDescriptor extends AbstractScalarFunctionDynami
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ADuration> durationSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ADURATION);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -90,8 +86,6 @@ public class ADurationConstructorDescriptor extends AbstractScalarFunctionDynami
ADurationParserFactory.parseDuration(serString, utf8Ptr.getCharStartOffset(),
stringLength, aDuration, ADurationParseOption.All);
durationSerde.serialize(aDuration, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
index 842ebab..e293552 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
@@ -25,7 +25,6 @@ import org.apache.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AFloat;
import org.apache.asterix.om.base.AMutableFloat;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -86,9 +85,6 @@ public class AFloatConstructorDescriptor extends AbstractScalarFunctionDynamicDe
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AFloat> floatSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AFLOAT);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -115,8 +111,6 @@ public class AFloatConstructorDescriptor extends AbstractScalarFunctionDynamicDe
aFloat.setValue(Float.parseFloat(utf8Ptr.toString()));
}
floatSerde.serialize(aFloat, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
index 2a0d795..f413c82 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInt16;
import org.apache.asterix.om.base.AMutableInt16;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -73,9 +72,6 @@ public class AInt16ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInt16> int16Serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT16);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -118,8 +114,6 @@ public class AInt16ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
aInt16.setValue(value);
int16Serde.serialize(aInt16, out);
- } else if (serString[startOffset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
index 3d335f2..a727026 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInt32;
import org.apache.asterix.om.base.AMutableInt32;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -72,9 +71,6 @@ public class AInt32ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInt32> int32Serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT32);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -117,8 +113,6 @@ public class AInt32ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
aInt32.setValue(value);
int32Serde.serialize(aInt32, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
index c658423..12775fb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInt64;
import org.apache.asterix.om.base.AMutableInt64;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -73,9 +72,6 @@ public class AInt64ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT64);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -118,8 +114,6 @@ public class AInt64ConstructorDescriptor extends AbstractScalarFunctionDynamicDe
aInt64.setValue(value);
int64Serde.serialize(aInt64, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
index c865820..90359de 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInt8;
import org.apache.asterix.om.base.AMutableInt8;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -73,9 +72,6 @@ public class AInt8ConstructorDescriptor extends AbstractScalarFunctionDynamicDes
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInt8> int8Serde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINT8);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -118,8 +114,6 @@ public class AInt8ConstructorDescriptor extends AbstractScalarFunctionDynamicDes
aInt8.setValue(value);
int8Serde.serialize(aInt8, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalConstructorDescriptor.java
index 172ad4f..ccfdb43 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalConstructorDescriptor.java
@@ -27,7 +27,6 @@ import org.apache.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeseriali
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInterval;
import org.apache.asterix.om.base.AMutableInterval;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -75,9 +74,6 @@ public class AIntervalConstructorDescriptor extends AbstractScalarFunctionDynami
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInterval> intervalSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINTERVAL);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
@Override
public void evaluate(IFrameTupleReference tuple, IPointable result) throws AlgebricksException {
@@ -91,13 +87,6 @@ public class AIntervalConstructorDescriptor extends AbstractScalarFunctionDynami
int offset1 = argPtr1.getStartOffset();
try {
- if (bytes0[offset0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || bytes1[offset1] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- return;
- }
-
if (bytes0[offset0] != bytes1[offset1]) {
throw new AlgebricksException(FID.getName()
+ ": expects both arguments to be of the same type. Either DATE/TIME/DATETIME, but got "
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
index 55ff7d1..ca115fb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
@@ -29,7 +29,6 @@ import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInterval;
import org.apache.asterix.om.base.AMutableDuration;
import org.apache.asterix.om.base.AMutableInterval;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.ADateParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
@@ -87,9 +86,6 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInterval> intervalSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINTERVAL);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -106,13 +102,6 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
int len1 = argPtr1.getLength();
try {
- if (bytes0[offset0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || bytes1[offset1] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- return;
- }
-
long intervalStart = 0, intervalEnd = 0;
if (bytes0[offset0] == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
intervalStart = ADateSerializerDeserializer.getChronon(bytes0, offset0 + 1)
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
index dab0714..b8c56fb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
@@ -29,7 +29,6 @@ import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInterval;
import org.apache.asterix.om.base.AMutableDuration;
import org.apache.asterix.om.base.AMutableInterval;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.ADateParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
@@ -85,9 +84,6 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInterval> intervalSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINTERVAL);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -103,13 +99,6 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
int len1 = argPtr1.getLength();
try {
- if (bytes0[offset0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || bytes1[offset1] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- return;
- }
-
long intervalStart = 0, intervalEnd = 0;
if (bytes0[offset0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
intervalStart = ADateTimeSerializerDeserializer.getChronon(bytes0, offset0 + 1);
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
index b3df622..49644f3 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
@@ -28,7 +28,6 @@ import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AInterval;
import org.apache.asterix.om.base.AMutableDuration;
import org.apache.asterix.om.base.AMutableInterval;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
import org.apache.asterix.om.base.temporal.ATimeParserFactory;
@@ -85,9 +84,6 @@ public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarF
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AInterval> intervalSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AINTERVAL);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -104,13 +100,6 @@ public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarF
int len1 = argPtr1.getLength();
try {
- if (bytes0[offset0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || bytes1[offset1] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- return;
- }
-
long intervalStart = 0, intervalEnd = 0;
if (bytes0[offset0] == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
intervalStart = ATimeSerializerDeserializer.getChronon(bytes0, offset0 + 1);
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
index 82e7150..b912a4e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
@@ -25,7 +25,6 @@ import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ALine;
import org.apache.asterix.om.base.AMutableLine;
import org.apache.asterix.om.base.AMutablePoint;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -73,9 +72,6 @@ public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDes
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ALine> lineSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ALINE);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -99,8 +95,6 @@ public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDes
Double.parseDouble(s.substring(commaIndex + 1, s.length())));
aLine.setValue(aPoint[0], aPoint[1]);
lineSerde.serialize(aLine, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
index 623d546..71359a8 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
@@ -23,7 +23,7 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlBinaryComparatorFactoryProvider;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import org.apache.asterix.om.base.ANull;
+import org.apache.asterix.om.base.AMissing;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -70,8 +70,8 @@ public class ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDes
IBinaryComparator utf8BinaryComparator = AqlBinaryComparatorFactoryProvider.UTF8STRING_POINTABLE_INSTANCE
.createBinaryComparator();
@SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
+ private ISerializerDeserializer<AMissing> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+ .getSerializerDeserializer(BuiltinType.AMISSING);
@Override
public void evaluate(IFrameTupleReference tuple, IPointable result) throws AlgebricksException {
@@ -85,7 +85,7 @@ public class ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDes
if (utf8BinaryComparator.compare(serString, offset + 1, len - 1, NULL, 0,
NULL.length) == 0) {
resultStorage.reset();
- nullSerde.serialize(ANull.NULL, out);
+ nullSerde.serialize(AMissing.MISSING, out);
result.set(resultStorage);
return;
} else {
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
index f0cea4b..b7982da 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutablePoint3D;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.APoint3D;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -71,9 +70,6 @@ public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamic
@SuppressWarnings("unchecked")
private ISerializerDeserializer<APoint3D> point3DSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.APOINT3D);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -94,8 +90,6 @@ public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamic
Double.parseDouble(s.substring(firstCommaIndex + 1, secondCommaIndex)),
Double.parseDouble(s.substring(secondCommaIndex + 1, s.length())));
point3DSerde.serialize(aPoint3D, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
index 32d1ae6..78ac2da 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutablePoint;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.APoint;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -70,9 +69,6 @@ public class APointConstructorDescriptor extends AbstractScalarFunctionDynamicDe
@SuppressWarnings("unchecked")
private ISerializerDeserializer<APoint> pointSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.APOINT);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -91,8 +87,6 @@ public class APointConstructorDescriptor extends AbstractScalarFunctionDynamicDe
aPoint.setValue(Double.parseDouble(s.substring(0, s.indexOf(','))),
Double.parseDouble(s.substring(s.indexOf(',') + 1, s.length())));
pointSerde.serialize(aPoint, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
index fc163ad..0735e37 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
@@ -22,20 +22,16 @@ import java.io.DataOutput;
import java.io.IOException;
import org.apache.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
-import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
import org.apache.asterix.om.types.ATypeTag;
-import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
import org.apache.hyracks.data.std.primitive.VoidPointable;
@@ -65,9 +61,6 @@ public class APolygonConstructorDescriptor extends AbstractScalarFunctionDynamic
private IPointable inputArg = new VoidPointable();
private IScalarEvaluator eval = args[0].createScalarEvaluator(ctx);
private String errorMessage = "This can not be an instance of polygon";
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -93,8 +86,6 @@ public class APolygonConstructorDescriptor extends AbstractScalarFunctionDynamic
APointSerializerDeserializer.serialize(Double.parseDouble(points[i].split(",")[0]),
Double.parseDouble(points[i].split(",")[1]), out);
}
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
index b2dbe1e..e6eb5c1 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutablePoint;
import org.apache.asterix.om.base.AMutableRectangle;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.ARectangle;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -72,9 +71,6 @@ public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynam
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ARectangle> rectangle2DSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ARECTANGLE);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -106,8 +102,6 @@ public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynam
"Rectangle arugment must be either (bottom left point, top right point) or (top right point, bottom left point)");
}
rectangle2DSerde.serialize(aRectangle, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
index 6399ace..930b584 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
@@ -28,20 +28,16 @@ import org.apache.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserial
import org.apache.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
import org.apache.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
import org.apache.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
-import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
import org.apache.asterix.om.types.ATypeTag;
-import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.primitive.VoidPointable;
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
@@ -72,9 +68,6 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
private DataOutput out = resultStorage.getDataOutput();
private IPointable inputArg = new VoidPointable();
private IScalarEvaluator eval = args[0].createScalarEvaluator(ctx);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private UTF8StringBuilder builder = new UTF8StringBuilder();
private GrowableArray baaos = new GrowableArray();
@@ -89,10 +82,7 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
int len = inputArg.getLength();
ATypeTag tt = ATypeTag.VALUE_TYPE_MAPPING[serString[offset]];
- if (tt == ATypeTag.NULL) {
- nullSerde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- } else if (tt == ATypeTag.STRING) {
+ if (tt == ATypeTag.STRING) {
result.set(inputArg);
} else {
builder.reset(baaos, len);
@@ -134,7 +124,7 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
break;
}
- // NotYetImplemented
+ // NotYetImplemented
case CIRCLE:
case DATE:
case DATETIME:
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
index ed8051d..a296ae9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutableTime;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.ATime;
import org.apache.asterix.om.base.temporal.ATimeParserFactory;
import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
@@ -72,9 +71,6 @@ public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDes
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ATIME);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -108,9 +104,6 @@ public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDes
aTime.setValue(chrononTimeInMs);
timeSerde.serialize(aTime, out);
-
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
index e058813..44140fb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
@@ -23,7 +23,6 @@ import java.io.IOException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutableUUID;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.AUUID;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -75,9 +74,6 @@ public class AUUIDFromStringConstructorDescriptor extends AbstractScalarFunction
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AUUID> uuidSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AUUID);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@@ -96,8 +92,6 @@ public class AUUIDFromStringConstructorDescriptor extends AbstractScalarFunction
int offset = utf8Ptr.getCharStartOffset();
uuid.parseUUIDHexBytes(serString, offset);
uuidSerde.serialize(uuid, out);
- } else if (serString[start] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
index eaf8257..160043f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
@@ -22,7 +22,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutableYearMonthDuration;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.AYearMonthDuration;
import org.apache.asterix.om.base.temporal.ADurationParserFactory;
import org.apache.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
@@ -72,9 +71,6 @@ public class AYearMonthDurationConstructorDescriptor extends AbstractScalarFunct
@SuppressWarnings("unchecked")
private ISerializerDeserializer<AYearMonthDuration> yearMonthDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.AYEARMONTHDURATION);
- @SuppressWarnings("unchecked")
- private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final UTF8StringPointable utf8Ptr = new UTF8StringPointable();
@Override
@@ -92,8 +88,6 @@ public class AYearMonthDurationConstructorDescriptor extends AbstractScalarFunct
ADurationParserFactory.parseDuration(serString, utf8Ptr.getCharStartOffset(),
stringLength, aYearMonthDuration, ADurationParseOption.YEAR_MONTH);
yearMonthDurationSerde.serialize(aYearMonthDuration, out);
- } else if (serString[offset] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, out);
} else {
throw new AlgebricksException(errorMessage);
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
index af3ba54..f6ff2d9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
@@ -97,14 +97,20 @@ public class OpenRecordConstructorDescriptor extends AbstractScalarFunctionDynam
recBuilder.init();
for (int i = 0; i < evalFields.length; i++) {
evalFields[i].evaluate(tuple, fieldValuePointable);
- if (openFields[i]) {
+ byte[] data = fieldValuePointable.getByteArray();
+ int offset = fieldValuePointable.getStartOffset();
+ boolean openField = openFields[i];
+ if (openField && data[offset] != ATypeTag.SERIALIZED_MISSING_TYPE_TAG) {
+ // MISSING for an open field means the field does not exist.
evalNames[i].evaluate(tuple, fieldNamePointable);
recBuilder.addField(fieldNamePointable, fieldValuePointable);
- } else {
- if (fieldValuePointable.getByteArray()[fieldValuePointable
- .getStartOffset()] != ATypeTag.NULL.serialize()) {
- recBuilder.addField(closedFieldId, fieldValuePointable);
- }
+ }
+ if (!openField && data[offset] == ATypeTag.SERIALIZED_MISSING_TYPE_TAG) {
+ // Turns MISSING into NULL for a closed field.
+ data[offset] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
+ }
+ if (!openField) {
+ recBuilder.addField(closedFieldId, fieldValuePointable);
closedFieldId++;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
index 4a5c59a..fd89493 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
@@ -22,7 +22,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ABoolean;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.EnumDeserializer;
@@ -56,9 +55,6 @@ public abstract class AbstractBinaryStringBoolEval implements IScalarEvaluator {
@SuppressWarnings({ "rawtypes" })
private ISerializerDeserializer boolSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ABOOLEAN);
- @SuppressWarnings("unchecked")
- private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
public AbstractBinaryStringBoolEval(IHyracksTaskContext context, IScalarEvaluatorFactory evalLeftFactory,
IScalarEvaluatorFactory evalRightFactory, FunctionIdentifier funcID) throws AlgebricksException {
@@ -81,20 +77,11 @@ public abstract class AbstractBinaryStringBoolEval implements IScalarEvaluator {
int len1 = ptr1.getLength();
resultStorage.reset();
- try {
- if (bytes0[offset0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || bytes1[offset1] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, dout);
- result.set(resultStorage);
- return;
- } else if (bytes0[offset0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || bytes1[offset1] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- throw new AlgebricksException(funcID.getName() + ": expects input type STRING or NULL, but got "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes0[offset0]) + " and "
- + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes1[offset1]) + ")!");
- }
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
+ if (bytes0[offset0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || bytes1[offset1] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ throw new AlgebricksException(funcID.getName() + ": expects input type STRING or NULL, but got "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes0[offset0]) + " and "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes1[offset1]) + ")!");
}
leftPtr.set(bytes0, offset0 + 1, len0 - 1);
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
index 0d262fb..56b473e 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
@@ -43,7 +43,6 @@ import org.apache.asterix.om.base.AMutableInt32;
import org.apache.asterix.om.base.AMutableInt64;
import org.apache.asterix.om.base.AMutableInt8;
import org.apache.asterix.om.base.AMutableTime;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
@@ -136,21 +135,15 @@ public abstract class AbstractNumericArithmeticEval extends AbstractScalarFuncti
@SuppressWarnings("unchecked")
@Override
public void evaluate(IFrameTupleReference tuple, IPointable result) throws AlgebricksException {
-
try {
resultStorage.reset();
resultType = 0;
int currentType = 0;
- for (int i = 0; i < args.length; i++) {
- IPointable argPtr;
- if (i == 0) {
- evalLeft.evaluate(tuple, argPtr0);
- argPtr = argPtr0;
- } else {
- evalRight.evaluate(tuple, argPtr1);
- argPtr = argPtr1;
- }
+ evalLeft.evaluate(tuple, argPtr0);
+ evalRight.evaluate(tuple, argPtr1);
+ for (int i = 0; i < args.length; i++) {
+ IPointable argPtr = i == 0 ? argPtr0 : argPtr1;
byte[] bytes = argPtr.getByteArray();
int offset = argPtr.getStartOffset();
@@ -197,16 +190,9 @@ public abstract class AbstractNumericArithmeticEval extends AbstractScalarFuncti
case DURATION:
case YEARMONTHDURATION:
case DAYTIMEDURATION:
- evaluateTemporalArthmeticOperation(typeTag, tuple);
+ evaluateTemporalArthmeticOperation(typeTag);
result.set(resultStorage);
return;
- case NULL: {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- result.set(resultStorage);
- return;
- }
default: {
throw new NotImplementedException(getIdentifier().getName()
+ (i == 0 ? ": Left" : ": Right")
@@ -296,22 +282,14 @@ public abstract class AbstractNumericArithmeticEval extends AbstractScalarFuncti
}
@SuppressWarnings("unchecked")
- private void evaluateTemporalArthmeticOperation(ATypeTag leftType, IFrameTupleReference tuple)
+ private void evaluateTemporalArthmeticOperation(ATypeTag leftType)
throws HyracksDataException, AlgebricksException {
- evalRight.evaluate(tuple, argPtr1);
byte[] bytes1 = argPtr1.getByteArray();
int offset1 = argPtr1.getStartOffset();
ATypeTag rightType = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes1[offset1]);
byte[] bytes0 = argPtr0.getByteArray();
int offset0 = argPtr0.getStartOffset();
- if (leftType == ATypeTag.NULL || rightType == ATypeTag.NULL) {
- serde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- serde.serialize(ANull.NULL, out);
- return;
- }
-
if (rightType == leftType) {
serde = AqlSerializerDeserializerProvider.INSTANCE
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
index 0085461..daa9a54 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
@@ -26,7 +26,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutableString;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.EnumDeserializer;
@@ -60,9 +59,6 @@ public abstract class AbstractQuadStringStringEval implements IScalarEvaluator {
private AMutableString resultBuffer = new AMutableString("");
@SuppressWarnings("rawtypes")
- private ISerializerDeserializer nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- @SuppressWarnings("rawtypes")
private ISerializerDeserializer strSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ASTRING);
@@ -90,34 +86,20 @@ public abstract class AbstractQuadStringStringEval implements IScalarEvaluator {
eval3.evaluate(tuple, array3);
resultStorage.reset();
- try {
- if (array0.getByteArray()[array0.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array3.getByteArray()[array3.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, dout);
- result.set(resultStorage);
- return;
- } else if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array3.getByteArray()[array3.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- throw new AlgebricksException(funcID.getName()
- + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL, STRING/NULL), but got ("
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array0.getByteArray()[array0.getStartOffset()])
- + ", "
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array1.getByteArray()[array1.getStartOffset()])
- + ", "
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array2.getByteArray()[array2.getStartOffset()])
- + ", " + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array3.getByteArray()[array3.getStartOffset()])
- + ".");
- }
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
+ if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array3.getByteArray()[array3.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ throw new AlgebricksException(funcID.getName()
+ + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL, STRING/NULL), but got ("
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[array0.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[array1.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[array2.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array3.getByteArray()[array3.getStartOffset()])
+ + ".");
}
strPtr1st.set(array0.getByteArray(), array0.getStartOffset() + 1, array0.getLength());
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
index f1f07dd..6f1ce15 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
@@ -22,7 +22,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.ABoolean;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.EnumDeserializer;
@@ -53,9 +52,6 @@ public abstract class AbstractTripleStringBoolEval implements IScalarEvaluator {
@SuppressWarnings("rawtypes")
private ISerializerDeserializer boolSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ABOOLEAN);
- @SuppressWarnings("unchecked")
- private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
private final FunctionIdentifier funcID;
@@ -65,7 +61,7 @@ public abstract class AbstractTripleStringBoolEval implements IScalarEvaluator {
public AbstractTripleStringBoolEval(IHyracksTaskContext context, IScalarEvaluatorFactory eval0,
IScalarEvaluatorFactory eval1, IScalarEvaluatorFactory eval2, FunctionIdentifier funcID)
- throws AlgebricksException {
+ throws AlgebricksException {
this.eval0 = eval0.createScalarEvaluator(context);
this.eval1 = eval1.createScalarEvaluator(context);
this.eval2 = eval2.createScalarEvaluator(context);
@@ -80,32 +76,17 @@ public abstract class AbstractTripleStringBoolEval implements IScalarEvaluator {
eval2.evaluate(tuple, array2);
resultStorage.reset();
- try {
- if (array0.getByteArray()[array0.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, dout);
- result.set(resultStorage);
- return;
- }
-
- if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- throw new AlgebricksException(
- funcID.getName() + ": expects iput type (STRING/NULL, STRING/NULL, STRING) but got ("
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array0.getByteArray()[array0.getStartOffset()])
- + ", "
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array1.getByteArray()[array1.getStartOffset()])
- + ", " + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array2.getByteArray()[array2.getStartOffset()])
- + ")");
- }
-
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
+ if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ throw new AlgebricksException(funcID.getName()
+ + ": expects iput type (STRING/NULL, STRING/NULL, STRING/NULL) but got ("
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[array0.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[array1.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[array2.getStartOffset()])
+ + ")");
}
strPtr1st.set(array0.getByteArray(), array0.getStartOffset() + 1, array0.getLength());
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/535d86b5/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
index 7511b82..bcbee23 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
@@ -22,7 +22,6 @@ import java.io.DataOutput;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AMutableString;
-import org.apache.asterix.om.base.ANull;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.EnumDeserializer;
@@ -52,9 +51,6 @@ public abstract class AbstractTripleStringStringEval implements IScalarEvaluator
private AMutableString resultBuffer = new AMutableString("");
@SuppressWarnings("rawtypes")
- private ISerializerDeserializer nullSerde = AqlSerializerDeserializerProvider.INSTANCE
- .getSerializerDeserializer(BuiltinType.ANULL);
- @SuppressWarnings("rawtypes")
private ISerializerDeserializer strSerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(BuiltinType.ASTRING);
@@ -66,7 +62,7 @@ public abstract class AbstractTripleStringStringEval implements IScalarEvaluator
public AbstractTripleStringStringEval(IHyracksTaskContext context, IScalarEvaluatorFactory eval0,
IScalarEvaluatorFactory eval1, IScalarEvaluatorFactory eval2, FunctionIdentifier funcID)
- throws AlgebricksException {
+ throws AlgebricksException {
this.eval0 = eval0.createScalarEvaluator(context);
this.eval1 = eval1.createScalarEvaluator(context);
this.eval2 = eval2.createScalarEvaluator(context);
@@ -81,29 +77,17 @@ public abstract class AbstractTripleStringStringEval implements IScalarEvaluator
eval2.evaluate(tuple, array2);
resultStorage.reset();
- try {
- if (array0.getByteArray()[array0.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
- nullSerde.serialize(ANull.NULL, dout);
- result.set(resultStorage);
- return;
- } else if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
- || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
- throw new AlgebricksException(
- funcID.getName() + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL), but got ("
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array0.getByteArray()[array0.getStartOffset()])
- + ", "
- + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array1.getByteArray()[array1.getStartOffset()])
- + ", " + EnumDeserializer.ATYPETAGDESERIALIZER
- .deserialize(array2.getByteArray()[array2.getStartOffset()])
- + ".");
- }
- } catch (HyracksDataException e) {
- throw new AlgebricksException(e);
+ if (array0.getByteArray()[array0.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array1.getByteArray()[array1.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+ || array2.getByteArray()[array2.getStartOffset()] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+ throw new AlgebricksException(funcID.getName()
+ + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL), but got ("
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[array0.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[array1.getStartOffset()])
+ + ", "
+ + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[array2.getStartOffset()])
+ + ".");
}
strPtr1st.set(array0.getByteArray(), array0.getStartOffset() + 1, array0.getLength());