core/src/main/java/org/apache/hop/core/sql/SqlCondition.java
private String processDateToStr(String element) throws HopSqlException {
    Matcher dateToStrMatcher = DATE_TO_STR_REGEX_PATTERN.matcher(element);
    if (dateToStrMatcher.matches()) {
      String dateToStrFieldName = dateToStrMatcher.group(1);
      String dateToStrMatcherValue = resolveEscapedSingleQuotes(dateToStrMatcher.group(2));

      // get clean field name
      dateToStrFieldName = getCleansedName(getAlias(dateToStrFieldName).orElse(dateToStrFieldName));

      validateDateToStrField(element, dateToStrFieldName);

      // placeholder field name & lookup key
      String resultFieldName =
          "__date_to_str_" + dateToStrFieldName.toLowerCase() + "_" + dateToStrMatcherValue;
      if (dateToStrFunctions.containsKey(resultFieldName)) {
        return dateToStrFunctions.get(resultFieldName).getResultName();
      }

      // create new mapping
      if (dateToStrFunctions.isEmpty()) {
        // on first use, replace with a mutable instance
        dateToStrFunctions = new HashMap<>();
      }
      dateToStrFunctions.put(
          resultFieldName,
          new DateToStrFunction(dateToStrFieldName, dateToStrMatcherValue, resultFieldName));
      return resultFieldName;
    } else {
      return element;
    }
  }
/**
   * Replace DATE_TO_STR() call with internal field name and store call to name mapping.
   *
   * @param element Atomic element to match.
   * @return Internal field name for call result if it is a DATE_TO_STR() call, otherwise returns
   *     the original value.
   */
Replace DATE_TO_STR() call with internal field name and store call to name mapping.
@param element Atomic element to match.
@return Internal field name for call result if it is a DATE_TO_STR() call, otherwise returns
the original value.
Replace DATE_TO_STR () call with internal field name and store call to name mapping . @param element Atomic element to match . @return Internal field name for call result if it is a DATE_TO_STR () call otherwise returns the original value .
private String processDateToStr(String element) throws HopSqlException {
    Matcher dateToStrMatcher = DATE_TO_STR_REGEX_PATTERN.matcher(element);
    if (dateToStrMatcher.matches()) {
      String dateToStrFieldName = dateToStrMatcher.group(1);
      String dateToStrMatcherValue = resolveEscapedSingleQuotes(dateToStrMatcher.group(2));
      dateToStrFieldName = getCleansedName(getAlias(dateToStrFieldName).orElse(dateToStrFieldName));
      validateDateToStrField(element, dateToStrFieldName);
      String resultFieldName =
          "__date_to_str_" + dateToStrFieldName.toLowerCase() + "_" + dateToStrMatcherValue;
      if (dateToStrFunctions.containsKey(resultFieldName)) {
        return dateToStrFunctions.get(resultFieldName).getResultName();
      }
      if (dateToStrFunctions.isEmpty()) {
        dateToStrFunctions = new HashMap<>();
      }
      dateToStrFunctions.put(
          resultFieldName,
          new DateToStrFunction(dateToStrFieldName, dateToStrMatcherValue, resultFieldName));
      return resultFieldName;
    } else {
      return element;
    }
  }
private String processDateToStr ( String element ) throws HopSqlException { Matcher dateToStrMatcher = DATE_TO_STR_REGEX_PATTERN . matcher ( element ) ; if ( dateToStrMatcher . matches ( ) ) { String dateToStrFieldName = dateToStrMatcher . group ( 1 ) ; String dateToStrMatcherValue = resolveEscapedSingleQuotes ( dateToStrMatcher . group ( 2 ) ) ; dateToStrFieldName = getCleansedName ( getAlias ( dateToStrFieldName ) . orElse ( dateToStrFieldName ) ) ; validateDateToStrField ( element , dateToStrFieldName ) ; String resultFieldName = "__date_to_str_" + dateToStrFieldName . toLowerCase ( ) + "_" + dateToStrMatcherValue ; if ( dateToStrFunctions . containsKey ( resultFieldName ) ) { return dateToStrFunctions . get ( resultFieldName ) . getResultName ( ) ; } if ( dateToStrFunctions . isEmpty ( ) ) { dateToStrFunctions = new HashMap < > ( ) ; } dateToStrFunctions . put ( resultFieldName , new DateToStrFunction ( dateToStrFieldName , dateToStrMatcherValue , resultFieldName ) ) ; return resultFieldName ; } else { return element ; } }
Replace DATE_TO_STR() call with internal field name and store call to name mapping.
Replace DATE_TO_STR () call with internal field name and store call to name mapping .
// get clean field name // placeholder field name & lookup key // create new mapping // on first use, replace with a mutable instance