Skip to content

Commit

Permalink
[FLINK-9742] [table] Add helper method to access private Expression.r…
Browse files Browse the repository at this point in the history
…esultType.

This closes apache#6252.
  • Loading branch information
HeartSaVioR authored and fhueske committed Jul 5, 2018
1 parent 84fbbfe commit 5cb080c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,22 @@ import java.lang.{Boolean => JBoolean, Byte => JByte, Double => JDouble, Float =
import java.math.{BigDecimal => JBigDecimal}
import java.sql.{Date, Time, Timestamp}

import org.apache.flink.api.common.typeinfo.BasicTypeInfo
import org.apache.flink.api.common.typeinfo.{BasicTypeInfo, TypeInformation}
import org.apache.flink.streaming.api.windowing.time.{Time => FlinkTime}
import org.apache.flink.table.api.ValidationException
import org.apache.flink.table.calcite.FlinkTypeFactory
import org.apache.flink.table.typeutils.{RowIntervalTypeInfo, TimeIntervalTypeInfo}

object ExpressionUtils {
/**
* Retrieve result type of given Expression.
*
* @param expr The expression which caller is interested about result type
* @return The result type of Expression
*/
def getResultType(expr: Expression): TypeInformation[_] = {
expr.resultType
}

private[flink] def isTimeIntervalLiteral(expr: Expression): Boolean = expr match {
case Literal(_, TimeIntervalTypeInfo.INTERVAL_MILLIS) => true
Expand Down

0 comments on commit 5cb080c

Please sign in to comment.