Index: ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java (revision 1188024) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java (working copy) @@ -186,7 +186,6 @@ NO_COMPARE_BIGINT_DOUBLE("In strict mode, comparing bigints and doubles is not allowed, " + "it may result in a loss of precision. " + "If you really want to perform the operation, set hive.mapred.mode=nonstrict"), - FUNCTIONS_ARE_NOT_SUPPORTED_IN_ORDER_BY("functions are not supported in order by"), ; private String mesg; Index: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java =================================================================== --- ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (revision 1188024) +++ ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java (working copy) @@ -4550,9 +4550,6 @@ // ClusterBy order.append("+"); } - if (cl.getType() == HiveParser.TOK_FUNCTION) { - throw new SemanticException(ErrorMsg.FUNCTIONS_ARE_NOT_SUPPORTED_IN_ORDER_BY.getMsg()); - } ExprNodeDesc exprNode = genExprNodeDesc(cl, inputRR); sortCols.add(exprNode); } Index: ql/src/test/queries/clientnegative/orderby_function.q =================================================================== --- ql/src/test/queries/clientnegative/orderby_function.q (revision 1188024) +++ ql/src/test/queries/clientnegative/orderby_function.q (working copy) @@ -1 +0,0 @@ -select src.key FROM src ORDER BY count(1) limit 1; Index: ql/src/test/results/clientnegative/orderby_function.q.out =================================================================== --- ql/src/test/results/clientnegative/orderby_function.q.out (revision 1188024) +++ ql/src/test/results/clientnegative/orderby_function.q.out (working copy) @@ -1 +0,0 @@ -FAILED: Error in semantic analysis: functions are not supported in order by