Skip to content

Commit f3932ca

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 0f39275 commit f3932ca

File tree

2 files changed

+19
-13
lines changed
  • x-pack/plugin/esql/src
    • main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date
    • test/java/org/elasticsearch/xpack/esql/expression/function/scalar/date

2 files changed

+19
-13
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ public DateParse(
9696
type = "keyword",
9797
valueHint = { "standard" },
9898
description = "The locale to use when parsing the date, relevant when parsing month names or week days."
99-
)
100-
},
99+
) },
101100
description = "(Optional) Additional options for date parsing as <<esql-function-named-params,function named parameters>>.",
102-
optional = true) Expression options
101+
optional = true
102+
) Expression options
103103
) {
104104
super(source, fields(first, second, options));
105105
this.field = second != null ? second : first;
@@ -209,10 +209,10 @@ public ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
209209
throw new IllegalArgumentException("unsupported data type for date_parse [" + format.dataType() + "]");
210210
}
211211
var parsedOptions = this.parseOptions();
212-
String localeAsString = (String)parsedOptions.get(LOCALE_PARAM_NAME);
212+
String localeAsString = (String) parsedOptions.get(LOCALE_PARAM_NAME);
213213
Locale locale = localeAsString == null ? null : LocaleUtils.parse(localeAsString);
214214

215-
String timezoneAsString = (String)parsedOptions.get(TIME_ZONE_PARAM_NAME);
215+
String timezoneAsString = (String) parsedOptions.get(TIME_ZONE_PARAM_NAME);
216216
ZoneId timezone = null;
217217
try {
218218
if (timezoneAsString != null) {

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseTests.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,13 @@ public void testInvalidLocale() {
176176
Source.EMPTY,
177177
new Literal(Source.EMPTY, new BytesRef(pattern), DataType.KEYWORD),
178178
field("str", DataType.KEYWORD),
179-
new MapExpression(Source.EMPTY, List.of(
180-
new Literal(Source.EMPTY, new BytesRef("locale"), DataType.KEYWORD),
181-
new Literal(Source.EMPTY, new BytesRef(locale), DataType.KEYWORD)
182-
))
179+
new MapExpression(
180+
Source.EMPTY,
181+
List.of(
182+
new Literal(Source.EMPTY, new BytesRef("locale"), DataType.KEYWORD),
183+
new Literal(Source.EMPTY, new BytesRef(locale), DataType.KEYWORD)
184+
)
185+
)
183186
)
184187
).get(driverContext)
185188
);
@@ -197,10 +200,13 @@ public void testInvalidTimezone() {
197200
Source.EMPTY,
198201
new Literal(Source.EMPTY, new BytesRef(pattern), DataType.KEYWORD),
199202
field("str", DataType.KEYWORD),
200-
new MapExpression(Source.EMPTY, List.of(
201-
new Literal(Source.EMPTY, new BytesRef("time_zone"), DataType.KEYWORD),
202-
new Literal(Source.EMPTY, new BytesRef(timezone), DataType.KEYWORD)
203-
))
203+
new MapExpression(
204+
Source.EMPTY,
205+
List.of(
206+
new Literal(Source.EMPTY, new BytesRef("time_zone"), DataType.KEYWORD),
207+
new Literal(Source.EMPTY, new BytesRef(timezone), DataType.KEYWORD)
208+
)
209+
)
204210
)
205211
).get(driverContext)
206212
);

0 commit comments

Comments
 (0)