提交 995bb3c6 authored 作者: Stéphane Eintrazi's avatar Stéphane Eintrazi

use toUpperEnglish on field value

上级 5b4f1933
...@@ -1496,15 +1496,15 @@ public class Function extends Expression implements FunctionCall { ...@@ -1496,15 +1496,15 @@ public class Function extends Expression implements FunctionCall {
result = ValueLong.get(datediff(v0.getString(), v1, v2)); result = ValueLong.get(datediff(v0.getString(), v1, v2));
break; break;
case DATE_TRUNC: case DATE_TRUNC:
// Retrieve the field value (e.g. 'day', 'microseconds', etc.). // Retrieve the field value (e.g. 'day', 'microseconds', etc.)
String fieldValue = v0.getString().toLowerCase(); String fieldValue = StringUtils.toUpperEnglish(v0.getString());
// Retrieve the dateValue. // Retrieve the dateValue.
long[] fieldDateAndTime = DateTimeUtils.dateAndTimeFromValue(v1); long[] fieldDateAndTime = DateTimeUtils.dateAndTimeFromValue(v1);
long fieldDateValue = fieldDateAndTime[0]; long fieldDateValue = fieldDateAndTime[0];
// Case where the date has to be truncated to the day. // Case where the date has to be truncated to the day.
if (fieldValue.equals("day")) { if (fieldValue.equals("DAY")) {
if (v1 instanceof ValueTime) { if (v1 instanceof ValueTime) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论