-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7886][SQL] Add built-in expressions to FunctionRegistry. #6463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- ExpressionBuilders is provided with helpers to create a function builder for each Expression. - Built-in functions removed from SqlParser when possible. Added to FunctionRegistry. TO DO: - Decide between the reflection and macro implementations of the expression builder helpers. - Fix Substring (whose constructor is not well suited for the helper). - Apply changes to Hive.
|
This is still a work in progress. @rxin I would like some feedback about how to continue with the implementation. In ExpressionBuilders I added some helper methods that can convert a Expression into a function name and a function builder (i.e. Any other feedback will be really appreciated. Thanks. |
|
Can one of the admins verify this patch? |
|
I'm working on a simpler solution without macros or reflection involved. |
|
Oh yes definitely prefer the no-macro way, since it is doable without macros. Thanks! |
|
Ping me when you think this is ready for review. Thanks! |
[SPARK-7886][SQL] Add built-in expressions to FunctionRegistry.
This patch switches to using FunctionRegistry for built-in expressions. It is based on #6463, but with some work to simplify it along with unit tests. TODOs for future pull requests: - Use static registration so we don't need to register all functions every time we start a new SQLContext - Switch to using this in HiveContext Author: Reynold Xin <rxin@databricks.com> Author: Santiago M. Mola <santi@mola.io> Closes #6710 from rxin/udf-registry and squashes the following commits: 6930822 [Reynold Xin] Fixed Python test. b802c9a [Reynold Xin] Made UDF case insensitive. e60d815 [Reynold Xin] Made UDF case insensitive. 852f9c0 [Reynold Xin] Fixed style violation. e76a3c1 [Reynold Xin] Fixed parser. 52ddaba [Reynold Xin] Fixed compilation. ee7854f [Reynold Xin] Improved error reporting. ff906f2 [Reynold Xin] More robust constructor calling. 77b46f1 [Reynold Xin] Simplified the code. 2a2a149 [Reynold Xin] Merge pull request #6463 from smola/SPARK-7886 8616924 [Santiago M. Mola] [SPARK-7886] Add built-in expressions to FunctionRegistry.
|
@rxin Thank you! I'm closing this PR. |
This patch switches to using FunctionRegistry for built-in expressions. It is based on apache#6463, but with some work to simplify it along with unit tests. TODOs for future pull requests: - Use static registration so we don't need to register all functions every time we start a new SQLContext - Switch to using this in HiveContext Author: Reynold Xin <rxin@databricks.com> Author: Santiago M. Mola <santi@mola.io> Closes apache#6710 from rxin/udf-registry and squashes the following commits: 6930822 [Reynold Xin] Fixed Python test. b802c9a [Reynold Xin] Made UDF case insensitive. e60d815 [Reynold Xin] Made UDF case insensitive. 852f9c0 [Reynold Xin] Fixed style violation. e76a3c1 [Reynold Xin] Fixed parser. 52ddaba [Reynold Xin] Fixed compilation. ee7854f [Reynold Xin] Improved error reporting. ff906f2 [Reynold Xin] More robust constructor calling. 77b46f1 [Reynold Xin] Simplified the code. 2a2a149 [Reynold Xin] Merge pull request apache#6463 from smola/SPARK-7886 8616924 [Santiago M. Mola] [SPARK-7886] Add built-in expressions to FunctionRegistry.
for each Expression.
FunctionRegistry.
TO DO:
expression builder helpers.