addressed Sattam's review comments
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/IntervalBinDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/IntervalBinDescriptor.java
index 28ce0db..98c1d16 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/IntervalBinDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/IntervalBinDescriptor.java
@@ -123,6 +123,12 @@
ATypeTag type1 = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut1.getByteArray()[0]);
+ if (type0 != type1) {
+ if (type0 != ATypeTag.NULL && type1 != ATypeTag.NULL)
+ throw new AlgebricksException(getIdentifier().getName() + ": expecting " + type0
+ + " for the second argument but got " + type1);
+ }
+
long chrononToStart = 0;
switch (type1) {
case DATE:
@@ -246,8 +252,8 @@
}
return;
default:
- throw new AlgebricksException(getIdentifier().getName() + ": expecting " + type0
- + " for the second argument but got " + type1);
+ throw new AlgebricksException(getIdentifier().getName()
+ + ": the first argument should be DATE/TIME/DATETIME/NULL but got " + type0);
}
aInterval.setValue(binStartChronon, binEndChronon, type0.serialize());