用spark执行SQL保存到Hive中:
hiveContext.sql("insert overwrite table test select * from aaa")
执行完成,没报错,但是核对结果的时候,发现有几笔数据超出指定范围(实际只包含100/200)
最终排查到是ret_pay_remark 字段包含换行符,解决方案:执行SQL中把特殊字符替换掉
regexp_replace(ret.pay_remark, '\n|\t|\r', '') ret_pay_remark