dawidwys commented on a change in pull request #8510: [FLINK-12254][table]
Update cast() and TypeLiteralExpression to new type system
URL: https://github.com/apache/flink/pull/8510#discussion_r287685841
##########
File path:
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
##########
@@ -262,15 +264,22 @@ trait ImplicitExpressionOperations {
def collect: Expression = call(COLLECT, expr)
/**
- * Converts a value to a given type.
+ * Converts a value to a given data type.
*
- * e.g. "42".cast(Types.INT) leads to 42.
+ * e.g. "42".cast(DataTypes.INT()) leads to 42.
*
* @return casted expression
*/
- def cast(toType: TypeInformation[_]): Expression =
+ def cast(toType: DataType): Expression =
call(CAST, expr, typeLiteral(toType))
+ /**
+ * @deprecated Use [[cast(DataType)]] instead.
Review comment:
nit: Could we add a bit longer note that it might be unsafe to mix the
`DataType` and `TypeInformation` stacks?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services