Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix build error
  • Loading branch information
mgaido91 committed Jan 15, 2018
commit 1f36cf6bcf784a04d77b2b5153cd504e6155c875
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
}

test("decimal precision with multiply/division") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just move these tests to the new decimal.sql?

withSQLConf(SQLConf.DECIMAL_OPERATIONS_ALLOW_TRUNCAT.key -> "false") {
withSQLConf(SQLConf.DECIMAL_OPERATIONS_ALLOW_PREC_LOSS.key -> "false") {
checkAnswer(sql("select 10.3 * 3.0"), Row(BigDecimal("30.90")))
checkAnswer(sql("select 10.3000 * 3.0"), Row(BigDecimal("30.90000")))
checkAnswer(sql("select 10.30000 * 30.0"), Row(BigDecimal("309.000000")))
Expand All @@ -1535,7 +1535,7 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
checkAnswer(sql("select 10.3000000000000000000 / 3.00000000000000000"),
Row(BigDecimal("3.4333333333333333333333333333", new MathContext(38))))
}
withSQLConf(SQLConf.DECIMAL_OPERATIONS_ALLOW_TRUNCAT.key -> "true") {
withSQLConf(SQLConf.DECIMAL_OPERATIONS_ALLOW_PREC_LOSS.key -> "true") {
checkAnswer(sql("select 10.3 * 3.0"), Row(BigDecimal("30.90")))
checkAnswer(sql("select 10.3000 * 3.0"), Row(BigDecimal("30.90000")))
checkAnswer(sql("select 10.30000 * 30.0"), Row(BigDecimal("309.000000")))
Expand Down