hiveSql常见错误记录

1. In strict mode, if ORDER BY is specified, LIMIT must also be specified.

这个错误提示是因为在hive下写的sql使用了order by对数据进行数据排序,因为order by事实上是全局排序,因此,在reduce阶段仅为一个reduce做汇总,为此,数据量庞大,在hive的严格模式下禁止全局排序的。

两种解决方案

  • 更改hive严格模式设定set hive.mapred.mode = nonstrict
  • SQL末尾增加limit限定

猜你喜欢

转载自www.cnblogs.com/Sinkinghost/p/9842864.html