Skip to content

Commit

Permalink
[FLINK-8242] [table] RexProgramExtractor only translates literals of …
Browse files Browse the repository at this point in the history
…known types.
  • Loading branch information
fhueske committed Feb 5, 2018
1 parent 63a19e8 commit 9ad1fa7
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ import org.apache.flink.table.calcite.FlinkTypeFactory
import org.apache.flink.table.expressions.{And, Expression, Literal, Or, ResolvedFieldReference}
import org.apache.flink.table.validate.FunctionCatalog
import org.apache.flink.util.Preconditions

import java.sql.{Date, Time, Timestamp}

import org.slf4j.{Logger, LoggerFactory}

import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.util.{Failure, Success, Try}

object RexProgramExtractor {

lazy val LOG: Logger = LoggerFactory.getLogger(getClass)

/**
* Extracts the indices of input fields which accessed by the RexProgram.
*
Expand Down Expand Up @@ -214,7 +217,13 @@ class RexNodeToExpressionConverter(
// convert to BigDecimal
literal.getValueAs(classOf[java.math.BigDecimal])

case _ => literal.getValue
case _ =>
// Literal type is not supported.
RexProgramExtractor.LOG.debug(
"Literal {} of SQL type {} is not supported and cannot be converted. " +
"Please reach out to the community if you think this type should be supported.",
Array(literal, literal.getType): _*)
return None
}

Some(Literal(literalValue, literalType))
Expand Down

0 comments on commit 9ad1fa7

Please sign in to comment.