Skip to content

Commit

Permalink
add uts for decimal convert to int overflow case
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Jun 17, 2024
1 parent 810c26e commit d12c9a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ class GlutenClickHouseDecimalSuite
)
}

test("Fix issue(6015) allow overflow when converting decimal to integer") {
val sql = "select int(cast(id * 9999999999 as decimal(29, 2))) from range(10)"
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
}

def testFromRandomBase(
sql: String,
customCheck: DataFrame => Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,4 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS
runQueryAndCompare(q)(checkGlutenOperatorMatch[ProjectExecTransformer])
}
}

test("Fix issue(6016) allow overflow when converting decimal to integer") {
val sql = "select int(cast(id * 10000000000 as decimal(29, 2))) from range(10)"
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
}
}

0 comments on commit d12c9a4

Please sign in to comment.