override def toString()

in modules/spark-ext/spark/src/main/scala/org/apache/ignite/spark/impl/optimization/DateExpressions.scala [75:126]


    override def toString(expr: Expression, childToString: Expression ⇒ String, useQualifier: Boolean,
        useAlias: Boolean, caseSensitive: Boolean): Option[String] = expr match {
        case CurrentDate(_) ⇒
            Some(s"CURRENT_DATE()")

        case CurrentTimestamp() ⇒
            Some(s"CURRENT_TIMESTAMP()")

        case DateAdd(startDate, days) ⇒
            Some(s"CAST(DATEADD('DAY', ${childToString(days)}, ${childToString(startDate)}) AS DATE)")

        case DateDiff(date1, date2) ⇒
            Some(s"CAST(DATEDIFF('DAY', ${childToString(date1)}, ${childToString(date2)}) AS INT)")

        case DayOfMonth(date) ⇒
            Some(s"DAY_OF_MONTH(${childToString(date)})")

        case DayOfYear(date) ⇒
            Some(s"DAY_OF_YEAR(${childToString(date)})")

        case Hour(date, _) ⇒
            Some(s"HOUR(${childToString(date)})")

        case Minute(date, _) ⇒
            Some(s"MINUTE(${childToString(date)})")

        case Month(date) ⇒
            Some(s"MINUTE(${childToString(date)})")

        case ParseToDate(left, formatOption, _) ⇒
            formatOption match {
                case Some(format) ⇒
                    Some(s"PARSEDATETIME(${childToString(left)}, ${childToString(format)})")
                case None ⇒
                    Some(s"PARSEDATETIME(${childToString(left)})")
            }

        case Quarter(date) ⇒
            Some(s"QUARTER(${childToString(date)})")

        case Second(date, _) ⇒
            Some(s"SECOND(${childToString(date)})")

        case WeekOfYear(date) ⇒
            Some(s"WEEK(${childToString(date)})")

        case Year(date) ⇒
            Some(s"YEAR(${childToString(date)})")

        case _ ⇒
            None
    }