DateTimeFormatterUtil.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
package org.opensearch.sql.expression.datetime;
7
8
import com.google.common.collect.ImmutableMap;
9
import java.time.LocalDateTime;
10
import java.time.format.DateTimeFormatter;
11
import java.util.Locale;
12
import java.util.Map;
13
import java.util.regex.Matcher;
14
import java.util.regex.Pattern;
15
import org.opensearch.sql.data.model.ExprStringValue;
16
import org.opensearch.sql.data.model.ExprValue;
17
18
/**
19
 * This class converts a SQL style DATE_FORMAT format specifier and converts it to a
20
 * Java SimpleDateTime format.
21
 */
22
class DateTimeFormatterUtil {
23
  private static final int SUFFIX_SPECIAL_START_TH = 11;
24
  private static final int SUFFIX_SPECIAL_END_TH = 13;
25
  private static final String SUFFIX_SPECIAL_TH = "th";
26
  private static final Map<Integer, String> SUFFIX_CONVERTER =
27
      ImmutableMap.<Integer, String>builder()
28
      .put(1, "st").put(2, "nd").put(3, "rd").build();
29
30
  // The following have special cases that need handling outside of the format options provided
31
  // by the DateTimeFormatter class.
32
  interface DateTimeFormatHandler {
33
    String getFormat(LocalDateTime date);
34
  }
35
36
  private static final Map<String, DateTimeFormatHandler> HANDLERS =
37
      ImmutableMap.<String, DateTimeFormatHandler>builder()
38 1 1. lambda$static$0 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$0 → KILLED
      .put("%a", (date) -> "EEE") // %a => EEE - Abbreviated weekday name (Sun..Sat)
39 1 1. lambda$static$1 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$1 → KILLED
      .put("%b", (date) -> "LLL") // %b => LLL - Abbreviated month name (Jan..Dec)
40 1 1. lambda$static$2 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$2 → KILLED
      .put("%c", (date) -> "MM") // %c => MM - Month, numeric (0..12)
41 1 1. lambda$static$3 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$3 → KILLED
      .put("%d", (date) -> "dd") // %d => dd - Day of the month, numeric (00..31)
42 1 1. lambda$static$4 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$4 → KILLED
      .put("%e", (date) -> "d") // %e => d - Day of the month, numeric (0..31)
43 1 1. lambda$static$5 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$5 → KILLED
      .put("%H", (date) -> "HH") // %H => HH - (00..23)
44 1 1. lambda$static$6 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$6 → KILLED
      .put("%h", (date) -> "hh") // %h => hh - (01..12)
45 1 1. lambda$static$7 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$7 → KILLED
      .put("%I", (date) -> "hh") // %I => hh - (01..12)
46 1 1. lambda$static$8 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$8 → KILLED
      .put("%i", (date) -> "mm") // %i => mm - Minutes, numeric (00..59)
47 1 1. lambda$static$9 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$9 → KILLED
      .put("%j", (date) -> "DDD") // %j => DDD - (001..366)
48 1 1. lambda$static$10 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$10 → KILLED
      .put("%k", (date) -> "H") // %k => H - (0..23)
49 1 1. lambda$static$11 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$11 → KILLED
      .put("%l", (date) -> "h") // %l => h - (1..12)
50 1 1. lambda$static$12 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$12 → KILLED
      .put("%p", (date) -> "a") // %p => a - AM or PM
51 1 1. lambda$static$13 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$13 → KILLED
      .put("%M", (date) -> "LLLL") // %M => LLLL - Month name (January..December)
52 1 1. lambda$static$14 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$14 → KILLED
      .put("%m", (date) -> "MM") // %m => MM - Month, numeric (00..12)
53 1 1. lambda$static$15 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$15 → KILLED
      .put("%r", (date) -> "hh:mm:ss a") // %r => hh:mm:ss a - hh:mm:ss followed by AM or PM
54 1 1. lambda$static$16 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$16 → KILLED
      .put("%S", (date) -> "ss") // %S => ss - Seconds (00..59)
55 1 1. lambda$static$17 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$17 → KILLED
      .put("%s", (date) -> "ss") // %s => ss - Seconds (00..59)
56 1 1. lambda$static$18 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$18 → KILLED
      .put("%T", (date) -> "HH:mm:ss") // %T => HH:mm:ss
57 1 1. lambda$static$19 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$19 → KILLED
      .put("%W", (date) -> "EEEE") // %W => EEEE - Weekday name (Sunday..Saturday)
58 1 1. lambda$static$20 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$20 → KILLED
      .put("%Y", (date) -> "yyyy") // %Y => yyyy - Year, numeric, 4 digits
59 1 1. lambda$static$21 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$21 → KILLED
      .put("%y", (date) -> "yy") // %y => yy - Year, numeric, 2 digits
60
      // The following are not directly supported by DateTimeFormatter.
61
      .put("%D", (date) -> // %w - Day of month with English suffix
62 1 1. lambda$static$22 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$22 → KILLED
          String.format("'%d%s'", date.getDayOfMonth(), getSuffix(date.getDayOfMonth())))
63
      .put("%f", (date) -> // %f - Microseconds
64 2 1. lambda$static$23 : Replaced integer division with multiplication → KILLED
2. lambda$static$23 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$23 → KILLED
          String.format("'%d'", (date.getNano() / 1000)))
65
      .put("%w", (date) -> // %w - Day of week (0 indexed)
66 1 1. lambda$static$24 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$24 → KILLED
          String.format("'%d'", date.getDayOfWeek().getValue()))
67
      .put("%U", (date) -> // %U Week where Sunday is the first day - WEEK() mode 0
68 1 1. lambda$static$25 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$25 → KILLED
          String.format("'%d'", CalendarLookup.getWeekNumber(0, date.toLocalDate())))
69
      .put("%u", (date) -> // %u Week where Monday is the first day - WEEK() mode 1
70 1 1. lambda$static$26 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$26 → KILLED
          String.format("'%d'", CalendarLookup.getWeekNumber(1, date.toLocalDate())))
71
      .put("%V", (date) -> // %V Week where Sunday is the first day - WEEK() mode 2 used with %X
72 1 1. lambda$static$27 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$27 → KILLED
          String.format("'%d'", CalendarLookup.getWeekNumber(2, date.toLocalDate())))
73
      .put("%v", (date) -> // %v Week where Monday is the first day - WEEK() mode 3 used with %x
74 1 1. lambda$static$28 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$28 → KILLED
          String.format("'%d'", CalendarLookup.getWeekNumber(3, date.toLocalDate())))
75
      .put("%X", (date) -> // %X Year for week where Sunday is the first day, 4 digits used with %V
76 1 1. lambda$static$29 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$29 → KILLED
          String.format("'%d'", CalendarLookup.getYearNumber(2, date.toLocalDate())))
77
      .put("%x", (date) -> // %x Year for week where Monday is the first day, 4 digits used with %v
78 1 1. lambda$static$30 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$30 → KILLED
          String.format("'%d'", CalendarLookup.getYearNumber(3, date.toLocalDate())))
79
      .build();
80
81
  private static final Pattern pattern = Pattern.compile("%.");
82
  private static final Pattern CHARACTERS_WITH_NO_MOD_LITERAL_BEHIND_PATTERN
83
          = Pattern.compile("(?<!%)[a-zA-Z&&[^aydmshiHIMYDSEL]]+");
84
  private static final String MOD_LITERAL = "%";
85
86
  private DateTimeFormatterUtil() {
87
  }
88
89
  /**
90
   * Format the date using the date format String.
91
   * @param dateExpr the date ExprValue of Date/Datetime/Timestamp/String type.
92
   * @param formatExpr the format ExprValue of String type.
93
   * @return Date formatted using format and returned as a String.
94
   */
95
  static ExprValue getFormattedDate(ExprValue dateExpr, ExprValue formatExpr) {
96
    final LocalDateTime date = dateExpr.datetimeValue();
97
    final StringBuffer cleanFormat = new StringBuffer();
98
    final Matcher m = CHARACTERS_WITH_NO_MOD_LITERAL_BEHIND_PATTERN
99
            .matcher(formatExpr.stringValue());
100 1 1. getFormattedDate : negated conditional → KILLED
    while (m.find()) {
101
      m.appendReplacement(cleanFormat,String.format("'%s'", m.group()));
102
    }
103
    m.appendTail(cleanFormat);
104
105
    final Matcher matcher = pattern.matcher(cleanFormat.toString());
106
    final StringBuffer format = new StringBuffer();
107 1 1. getFormattedDate : negated conditional → KILLED
    while (matcher.find()) {
108
      matcher.appendReplacement(format,
109
          HANDLERS.getOrDefault(matcher.group(), (d) ->
110 1 1. lambda$getFormattedDate$31 : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$getFormattedDate$31 → KILLED
              String.format("'%s'", matcher.group().replaceFirst(MOD_LITERAL, "")))
111
              .getFormat(date));
112
    }
113
    matcher.appendTail(format);
114
115
    // English Locale matches SQL requirements.
116
    // 'AM'/'PM' instead of 'a.m.'/'p.m.'
117
    // 'Sat' instead of 'Sat.' etc
118 1 1. getFormattedDate : replaced return value with null for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getFormattedDate → KILLED
    return new ExprStringValue(date.format(
119
        DateTimeFormatter.ofPattern(format.toString(), Locale.ENGLISH)));
120
  }
121
122
  /**
123
   * Returns English suffix of incoming value.
124
   * @param val Incoming value.
125
   * @return English suffix as String (st, nd, rd, th)
126
   */
127
  private static String getSuffix(int val) {
128
    // The numbers 11, 12, and 13 do not follow general suffix rules.
129 4 1. getSuffix : changed conditional boundary → KILLED
2. getSuffix : changed conditional boundary → KILLED
3. getSuffix : negated conditional → KILLED
4. getSuffix : negated conditional → KILLED
    if ((SUFFIX_SPECIAL_START_TH <= val) && (val <= SUFFIX_SPECIAL_END_TH)) {
130 1 1. getSuffix : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getSuffix → KILLED
      return SUFFIX_SPECIAL_TH;
131
    }
132 2 1. getSuffix : Replaced integer modulus with multiplication → KILLED
2. getSuffix : replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getSuffix → KILLED
    return SUFFIX_CONVERTER.getOrDefault(val % 10, SUFFIX_SPECIAL_TH);
133
  }
134
}

Mutations

38

1.1
Location : lambda$static$0
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$0 → KILLED

39

1.1
Location : lambda$static$1
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$1 → KILLED

40

1.1
Location : lambda$static$2
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfLongWithFormat(java.lang.Long, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$2 → KILLED

41

1.1
Location : lambda$static$3
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfLongWithFormat(java.lang.Long, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$3 → KILLED

42

1.1
Location : lambda$static$4
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$4 → KILLED

43

1.1
Location : lambda$static$5
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$5 → KILLED

44

1.1
Location : lambda$static$6
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$6 → KILLED

45

1.1
Location : lambda$static$7
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$7 → KILLED

46

1.1
Location : lambda$static$8
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$8 → KILLED

47

1.1
Location : lambda$static$9
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#4]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$9 → KILLED

48

1.1
Location : lambda$static$10
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$10 → KILLED

49

1.1
Location : lambda$static$11
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$11 → KILLED

50

1.1
Location : lambda$static$12
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$12 → KILLED

51

1.1
Location : lambda$static$13
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#3]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$13 → KILLED

52

1.1
Location : lambda$static$14
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$14 → KILLED

53

1.1
Location : lambda$static$15
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$15 → KILLED

54

1.1
Location : lambda$static$16
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$16 → KILLED

55

1.1
Location : lambda$static$17
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfLongWithFormat(java.lang.Long, java.lang.String, java.lang.String)]/[test-template-invocation:#3]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$17 → KILLED

56

1.1
Location : lambda$static$18
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfLongWithFormat(java.lang.Long, java.lang.String, java.lang.String)]/[test-template-invocation:#4]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$18 → KILLED

57

1.1
Location : lambda$static$19
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#2]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$19 → KILLED

58

1.1
Location : lambda$static$20
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfLongWithFormat(java.lang.Long, java.lang.String, java.lang.String)]/[test-template-invocation:#2]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$20 → KILLED

59

1.1
Location : lambda$static$21
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$21 → KILLED

62

1.1
Location : lambda$static$22
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$22 → KILLED

64

1.1
Location : lambda$static$23
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
Replaced integer division with multiplication → KILLED

2.2
Location : lambda$static$23
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#1]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$23 → KILLED

66

1.1
Location : lambda$static$24
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$24 → KILLED

68

1.1
Location : lambda$static$25
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$25 → KILLED

70

1.1
Location : lambda$static$26
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$26 → KILLED

72

1.1
Location : lambda$static$27
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$27 → KILLED

74

1.1
Location : lambda$static$28
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$28 → KILLED

76

1.1
Location : lambda$static$29
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$29 → KILLED

78

1.1
Location : lambda$static$30
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$static$30 → KILLED

100

1.1
Location : getFormattedDate
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
negated conditional → KILLED

107

1.1
Location : getFormattedDate
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
negated conditional → KILLED

110

1.1
Location : lambda$getFormattedDate$31
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[method:checkInvalidFormat()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::lambda$getFormattedDate$31 → KILLED

118

1.1
Location : getFormattedDate
Killed by : org.opensearch.sql.expression.datetime.FromUnixTimeTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.FromUnixTimeTest]/[test-template:checkOfDoubleWithFormat(java.lang.Double, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
replaced return value with null for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getFormattedDate → KILLED

129

1.1
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
changed conditional boundary → KILLED

2.2
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
changed conditional boundary → KILLED

3.3
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
negated conditional → KILLED

4.4
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
negated conditional → KILLED

130

1.1
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getSuffix → KILLED

132

1.1
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
Replaced integer modulus with multiplication → KILLED

2.2
Location : getSuffix
Killed by : org.opensearch.sql.expression.datetime.DateTimeFunctionTest.[engine:junit-jupiter]/[class:org.opensearch.sql.expression.datetime.DateTimeFunctionTest]/[method:date_format()]
replaced return value with "" for org/opensearch/sql/expression/datetime/DateTimeFormatterUtil::getSuffix → KILLED

Active mutators

Tests examined


Report generated by PIT 1.9.0