背景:CDH Hive作业迁移到MaxCompute,SQL语法多数相同,但是部分函数存在行为差异,使用compatible模式可以以Hive模式运行SQL,达到平迁、最小化改动、快速上云降低成本的目的。
相关hint:set odps.sql.hive.compatible=true;
相关参考文档:https://help.aliyun.com/zh/maxcompute/user-guide/differences-in-sql-statements-between-the-maxcompute-v1-0-data-type-edition-and-hive-compatible-data-type-edition?spm=a2c4g.11186623.0.i1
-- hive from_unixtime(unix_timestamp(concat(translate(order_date, '/','-'),' 00:00:00')),'yyyy-MM-dd') as order_date, -- odps date_format(from_unixtime(unix_timestamp(concat(translate(order_date, '/','-'),' 00:00:00'))),'yyyy-MM-dd') as order_date,
-- hive ,ucase(t.store_no) -- odps ,toupper(t.store_no)