错误语句:select * from student_local cluster by sno sort by sage;
Error: Error while compiling statement: FAILED: SemanticException 1:51 Cannot have both CLUSTER BY and SORT BY clauses. Error encountered near token 'sage' (state=42000,code=40000)
原因:cluster by sort by无法共存
当分和字段一样时,distribute by(分) + sort by(分之后桶内的排序) 相当于 cluster by
select * from student_local distribute by sno sort by sno;
select * from student_local cluster by sno;
--上述两个sql执行的结果是一样的