aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorravipesala <ravindra.pesala@huawei.com>2014-10-01 23:53:21 -0700
committerMichael Armbrust <michael@databricks.com>2014-10-01 23:53:21 -0700
commitbbdf1de84ffdd3bd172f17975d2f1422a9bcf2c6 (patch)
tree27fa489ea89c801635da4e05692c7620b354bce8 /project
parentf341e1c8a284b55cceb367a432c1fa5203692155 (diff)
downloadspark-bbdf1de84ffdd3bd172f17975d2f1422a9bcf2c6.tar.gz
spark-bbdf1de84ffdd3bd172f17975d2f1422a9bcf2c6.tar.bz2
spark-bbdf1de84ffdd3bd172f17975d2f1422a9bcf2c6.zip
[SPARK-3371][SQL] Renaming a function expression with group by gives error
The following code gives error. ``` sqlContext.registerFunction("len", (s: String) => s.length) sqlContext.sql("select len(foo) as a, count(1) from t1 group by len(foo)").collect() ``` Because SQl parser creates the aliases to the functions in grouping expressions with generated alias names. So if user gives the alias names to the functions inside projection then it does not match the generated alias name of grouping expression. This kind of queries are working in Hive. So the fix I have given that if user provides alias to the function in projection then don't generate alias in grouping expression,use the same alias. Author: ravipesala <ravindra.pesala@huawei.com> Closes #2511 from ravipesala/SPARK-3371 and squashes the following commits: 9fb973f [ravipesala] Removed aliases to grouping expressions. f8ace79 [ravipesala] Fixed the testcase issue bad2fd0 [ravipesala] SPARK-3371 : Fixed Renaming a function expression with group by gives error
Diffstat (limited to 'project')
0 files changed, 0 insertions, 0 deletions