GitHub user petermaxlee opened a pull request: https://github.com/apache/spark/pull/14362
[SPARK-16730][SQL] Implement function aliases for type casts ## What changes were proposed in this pull request? Spark 1.x supports using the Hive type name as function names for doing casts, e.g. ```sql SELECT int(1.0); SELECT string(2.0); ``` The above query would work in Spark 1.x because Spark 1.x fail back to Hive for unimplemented functions, and break in Spark 2.0 because the fall back was removed. This patch implements function aliases using an analyzer rule for the following cast functions: - boolean - tinyint - smallint - int - bigint - float - double - decimal - date - timestamp - binary - string ## How was this patch tested? Added unit tests for SubstituteFunctionAliases as well as end-to-end tests for SQLCompatibilityFunctionSuite. You can merge this pull request into a Git repository by running: $ git pull https://github.com/petermaxlee/spark SPARK-16730 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/14362.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14362 ---- commit 37b7127cdbf93334daa05dc5f48715b78966d032 Author: petermaxlee <petermax...@gmail.com> Date: 2016-07-26T04:49:06Z [SPARK-16730][SQL] Implement function aliases for type casts ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org