Skip to content

Commit

Permalink
fix hdxx case (apache#195)
Browse files Browse the repository at this point in the history
# Checklist

* 内部Jira:
* 修复PR:
  * master:
  * 1.2-lts:
  * 1.2-lts: 
* Doris-master:
  * [ ] 已修复
  * [ ] 未修复
  * [ ] 无问题
* Doris-1.2-lts:
  * [ ] 已修复
  * [ ] 未修复
  * [ ] 无问题
* Doris-1.1-lts:
  * [ ] 已修复
  * [ ] 未修复
  * [ ] 无问题
  • Loading branch information
zy-kkk authored May 8, 2023
1 parent c6e9e93 commit c479ed1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 48 deletions.
28 changes: 28 additions & 0 deletions regression-test/suites/usercases/HDXX/load.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,32 @@ suite("load") {
sql """DROP TABLE IF EXISTS ${table}"""
sql new File("""${context.file.parent}/ddl/${table}.sql""").text
}
test {
sql '''
SELECT
a1.factory_code AS factory_code,
a1.material_type AS material_type,
a1.floor_code AS floor_code,
a1.location AS location,
a1.material_code AS material_code,
ifnull (a1.boxid, '') AS boxid,
MAX (a1.move_date) AS last_move_date, -- 去最大移动日期
DATEDIFF (now(), MAX (a1.move_date)) AS sluggish_day_qty, -- 计算呆滞天数 (当前时间-去最大移动日期)
SUM (IF (a1.move_type = '入库', ifnull (a1.quantity, 0), 0)) - SUM (IF (a1.move_type = '出库', ifnull (a1.quantity, 0), 0)) AS inv_qty
-- + SUM (IF (a1.move_type = '退库' AND a1.move_reason IN ('良品退库', '待领用'), ifnull (a1.quantity, 0), 0)) -- 逻辑修改,不算退库了
FROM dwd_wh_material_movement a1 -- 非胶水库存等于 (入库 - 出库 + 退库)
where a1.move_type <> '退库'
GROUP BY a1.factory_code,
a1.material_type,
a1.floor_code,
a1.location,
a1.material_code,
a1.boxid
'''
exception '''Syntax error in line 12:
-- + SUM (IF (a1.move_type =...
^
Encountered: Unknown last token with id: 420
Expected: COMMA'''
}
}
48 changes: 0 additions & 48 deletions regression-test/suites/usercases/HDXX/test.groovy

This file was deleted.

0 comments on commit c479ed1

Please sign in to comment.