From c479ed1ef732b02a03752f67231bc9fef147c57d Mon Sep 17 00:00:00 2001 From: "yongkang.zhong" Date: Mon, 8 May 2023 14:08:14 +0800 Subject: [PATCH] fix hdxx case (#195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Checklist * 内部Jira: * 修复PR: * master: * 1.2-lts: * 1.2-lts: * Doris-master: * [ ] 已修复 * [ ] 未修复 * [ ] 无问题 * Doris-1.2-lts: * [ ] 已修复 * [ ] 未修复 * [ ] 无问题 * Doris-1.1-lts: * [ ] 已修复 * [ ] 未修复 * [ ] 无问题 --- .../suites/usercases/HDXX/load.groovy | 28 +++++++++++ .../suites/usercases/HDXX/test.groovy | 48 ------------------- 2 files changed, 28 insertions(+), 48 deletions(-) delete mode 100644 regression-test/suites/usercases/HDXX/test.groovy diff --git a/regression-test/suites/usercases/HDXX/load.groovy b/regression-test/suites/usercases/HDXX/load.groovy index 6258d67c0a38dc7..7505b35a701819d 100644 --- a/regression-test/suites/usercases/HDXX/load.groovy +++ b/regression-test/suites/usercases/HDXX/load.groovy @@ -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''' + } } \ No newline at end of file diff --git a/regression-test/suites/usercases/HDXX/test.groovy b/regression-test/suites/usercases/HDXX/test.groovy deleted file mode 100644 index c9b980b04843e43..000000000000000 --- a/regression-test/suites/usercases/HDXX/test.groovy +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -suite("HDXX") { - 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 js_dwd.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: 418 -Expected: COMMA -''' - } -} \ No newline at end of file