Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
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
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3843,9 +3843,6 @@ lazy val `engine-runner` = project
.listFiles("*.jar")
.map(_.getAbsolutePath()) ++
`std-aws-polyglot-root`.listFiles("*.jar").map(_.getAbsolutePath()) ++
`std-snowflake-polyglot-root`
.listFiles("*.jar")
.map(_.getAbsolutePath()) ++
`std-tableau-polyglot-root`
.listFiles("*.jar")
.map(_.getAbsolutePath()) ++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
- dec x:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer|Standard.Base.Data.Numbers.Float) mc:(Standard.Base.Data.Numeric.Math_Context.Math_Context|Standard.Base.Nothing.Nothing)= -> Standard.Base.Data.Decimal.Decimal!(Standard.Base.Errors.Common.Arithmetic_Error|Standard.Base.Data.Numbers.Number_Parse_Error)
- error_if_from_float left:Standard.Base.Any.Any right:Standard.Base.Any.Any ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
- from_big_decimal that:Standard.Base.Any.Any -> Standard.Base.Any.Any
- get_big_decimal that:Standard.Base.Data.Decimal.Decimal -> Standard.Base.Any.Any
- handle_java_exception ~action:Standard.Base.Any.Any extra_message:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- handle_number_format_exception ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
- handle_precision_loss original_value:Standard.Base.Any.Any conversion_result:Standard.Base.Data.Decimal.ConversionResult -> Standard.Base.Any.Any
- handle_unsupported_argument_types ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
- value_with_scale that:Standard.Base.Data.Decimal.Decimal -> (Standard.Base.Data.Pair.Pair Standard.Base.Data.Numbers.Integer Standard.Base.Data.Numbers.Integer)
- Standard.Base.Data.Ordering.Comparable.from that:Standard.Base.Data.Decimal.Decimal -> Standard.Base.Data.Ordering.Comparable
- Standard.Base.Data.Ordering.Comparable.from that:Standard.Base.Data.Numbers.Number -> Standard.Base.Data.Ordering.Comparable
- Standard.Base.Data.Decimal.Decimal.from that:Standard.Base.Data.Text.Text -> Standard.Base.Data.Decimal.Decimal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import project.Data.Numeric.Math_Context.Math_Context
import project.Data.Numeric.Rounding_Mode.Rounding_Mode
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Data.Pair.Pair
import project.Error.Error
import project.Errors.Deprecated.Deprecated
import project.Errors.Illegal_Argument.Illegal_Argument
Expand Down Expand Up @@ -1467,8 +1468,10 @@ Float.from (that : Decimal) =
## ---
private: true
---
Helper method allowing access to the backing field.
get_big_decimal (that : Decimal) = that.big_decimal
Returns two numbers: the actual value and the scale associated to it

value_with_scale (that : Decimal) -> Pair Integer Integer =
Pair.new that.big_decimal.unscaledValue that.big_decimal.scale

## ---
private: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from Standard.Base import all
import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
import Standard.Base.Errors.Illegal_State.Illegal_State
from Standard.Base.Data.Decimal import get_big_decimal
from Standard.Base.Data.Decimal import value_with_scale

from Standard.Table import Value_Type

Expand Down Expand Up @@ -35,7 +35,9 @@ type Statement_Setter
Nothing -> stmt.setNull i Types.NULL
_ : Boolean -> stmt.setBoolean i value
_ : Integer -> jdbc_value_setter.setInteger stmt i value
_ : Decimal -> stmt.setBigDecimal i (get_big_decimal value)
d : Decimal ->
pair = value_with_scale d
jdbc_value_setter.setBigDecimal stmt i pair.first pair.second
_ : Float -> stmt.setDouble i value
_ : Text -> stmt.setString i value
_ : Date_Time ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from Standard.Base import all
import Standard.Base.Errors.Common.Index_Out_Of_Bounds
import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
import Standard.Base.Errors.Illegal_State.Illegal_State
from Standard.Base.Data.Decimal import from_big_decimal, get_big_decimal
from Standard.Base.Data.Decimal import from_big_decimal, value_with_scale

import project.Internal.Value_Type_Helpers
import project.Value_Type.Bits
Expand Down Expand Up @@ -89,7 +89,9 @@ closest_storage_type value_type = case value_type of
This step is unnecessary for primitive and builtin values, but necessary for
values such as `Decimal`/`BigDecimal`.
enso_to_java x = case x of
_ : Decimal -> get_big_decimal x
_ : Decimal ->
pair = value_with_scale x
BigDecimal.new pair.first pair.second
_ -> x

## ---
Expand Down
10 changes: 5 additions & 5 deletions project/GraalVM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ object GraalVM {
// Expected production NI sizes deduced from sizes on latest
// nightly builds: https://github.com/enso-org/enso/pull/12843#issuecomment-2869897463
// With maximal size relaxed by 30 MB.
private val windowsX64Release = NativeImageSize(200, 470)
private val linuxX64Release = NativeImageSize(200, 490)
private val macX64Release = NativeImageSize(200, 457)
private val macARM64Release = NativeImageSize(200, 473)
private val testNISize = NativeImageSize(100, 592)
private val windowsX64Release = NativeImageSize(200, 390)
private val linuxX64Release = NativeImageSize(200, 410)
private val macX64Release = NativeImageSize(200, 380)
private val macARM64Release = NativeImageSize(200, 390)
private val testNISize = NativeImageSize(100, 510)
}

/** Has the user requested to use Espresso for Java interop? */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.enso.database;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Types;
Expand Down Expand Up @@ -65,4 +67,11 @@ public void setLocalDate(PreparedStatement stmt, int columnIndex, LocalDate loca
throws SQLException {
stmt.setObject(columnIndex, localDate, Types.DATE);
}

public void setBigDecimal(
PreparedStatement stmt, int columnIndex, BigInteger unscaledValue, int scale)
throws SQLException {
var big = new BigDecimal(unscaledValue, scale);
stmt.setBigDecimal(columnIndex, big);
}
}
Loading
Loading