|
|
@ -487,37 +487,37 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> { |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.year().into()), |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.year().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.year().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.year().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.year().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.year().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::Month(e) => match self.eval_expression(e, tuple)? { |
|
|
|
PlanExpression::Month(e) => match self.eval_expression(e, tuple)? { |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.month().into()), |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.month().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.month().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.month().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.month().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.month().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::Day(e) => match self.eval_expression(e, tuple)? { |
|
|
|
PlanExpression::Day(e) => match self.eval_expression(e, tuple)? { |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.day().into()), |
|
|
|
EncodedTerm::NaiveDate(date) => Some(date.day().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.day().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.day().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.day().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.day().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::Hours(e) => match self.eval_expression(e, tuple)? { |
|
|
|
PlanExpression::Hours(e) => match self.eval_expression(e, tuple)? { |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.hour().into()), |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.hour().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.hour().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.hour().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.hour().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.hour().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::Minutes(e) => match self.eval_expression(e, tuple)? { |
|
|
|
PlanExpression::Minutes(e) => match self.eval_expression(e, tuple)? { |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.minute().into()), |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.minute().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.minute().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.minute().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.minute().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.minute().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::Seconds(e) => match self.eval_expression(e, tuple)? { |
|
|
|
PlanExpression::Seconds(e) => match self.eval_expression(e, tuple)? { |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.second().into()), |
|
|
|
EncodedTerm::NaiveTime(time) => Some(time.second().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.second().into()), |
|
|
|
EncodedTerm::DateTime(date_time) => Some(date_time.second().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.second().into()), |
|
|
|
EncodedTerm::NaiveDateTime(date_time) => Some(date_time.second().into()), |
|
|
|
_ => None |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
PlanExpression::UUID() => Some(EncodedTerm::NamedNode { |
|
|
|
PlanExpression::UUID() => Some(EncodedTerm::NamedNode { |
|
|
|
iri_id: self |
|
|
|
iri_id: self |
|
|
@ -963,26 +963,34 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> { |
|
|
|
EncodedTerm::DecimalLiteral(b) => a.partial_cmp(&b), |
|
|
|
EncodedTerm::DecimalLiteral(b) => a.partial_cmp(&b), |
|
|
|
_ => None, |
|
|
|
_ => None, |
|
|
|
}, |
|
|
|
}, |
|
|
|
EncodedTerm::NaiveDate(a) => if let EncodedTerm::NaiveDate(ref b) = b { |
|
|
|
EncodedTerm::NaiveDate(a) => { |
|
|
|
a.partial_cmp(b) |
|
|
|
if let EncodedTerm::NaiveDate(ref b) = b { |
|
|
|
} else { |
|
|
|
a.partial_cmp(b) |
|
|
|
None |
|
|
|
} else { |
|
|
|
}, |
|
|
|
None |
|
|
|
EncodedTerm::NaiveTime(a) => if let EncodedTerm::NaiveTime(ref b) = b { |
|
|
|
} |
|
|
|
a.partial_cmp(b) |
|
|
|
} |
|
|
|
} else { |
|
|
|
EncodedTerm::NaiveTime(a) => { |
|
|
|
None |
|
|
|
if let EncodedTerm::NaiveTime(ref b) = b { |
|
|
|
}, |
|
|
|
a.partial_cmp(b) |
|
|
|
EncodedTerm::DateTime(a) => if let EncodedTerm::DateTime(ref b) = b { |
|
|
|
} else { |
|
|
|
a.partial_cmp(b) |
|
|
|
None |
|
|
|
} else { |
|
|
|
} |
|
|
|
None |
|
|
|
} |
|
|
|
}, |
|
|
|
EncodedTerm::DateTime(a) => { |
|
|
|
EncodedTerm::NaiveDateTime(a) => if let EncodedTerm::NaiveDateTime(ref b) = b { |
|
|
|
if let EncodedTerm::DateTime(ref b) = b { |
|
|
|
a.partial_cmp(b) |
|
|
|
a.partial_cmp(b) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
None |
|
|
|
None |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EncodedTerm::NaiveDateTime(a) => { |
|
|
|
|
|
|
|
if let EncodedTerm::NaiveDateTime(ref b) = b { |
|
|
|
|
|
|
|
a.partial_cmp(b) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
None |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
_ => None, |
|
|
|
_ => None, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|