Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.doris.nereids.types.DecimalV3Type;

import com.google.common.base.Preconditions;
import org.apache.log4j.Logger;

import java.math.BigDecimal;
import java.math.RoundingMode;
Expand All @@ -34,8 +33,6 @@
* Literal for DecimalV3 Type
*/
public class DecimalV3Literal extends FractionalLiteral {
private static final Logger logger = Logger.getLogger(Literal.class);

private final BigDecimal value;

public DecimalV3Literal(BigDecimal value) {
Expand All @@ -57,8 +54,6 @@ public DecimalV3Literal(DecimalV3Type dataType, BigDecimal value) {
Objects.requireNonNull(value, "value not be null");
checkPrecisionAndScale(precision, scale, value);
BigDecimal adjustedValue = value.scale() < 0 ? value : value.setScale(scale, RoundingMode.HALF_UP);
logger.info("DecimalV3Literal orig bigDecimal: " + value
+ ", targetType: " + dataType + ", result big decimal: " + adjustedValue);
this.value = Objects.requireNonNull(adjustedValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.apache.doris.qe.SessionVariable;

import com.google.common.collect.ImmutableList;
import org.apache.log4j.Logger;

import java.math.BigDecimal;
import java.math.BigInteger;
Expand All @@ -70,7 +69,6 @@
*/
public abstract class Literal extends Expression implements LeafExpression {

private static final Logger logger = Logger.getLogger(Literal.class);
protected final DataType dataType;

/**
Expand Down Expand Up @@ -396,8 +394,6 @@ protected Expression getDecimalLiteral(BigDecimal bigDecimal, DataType targetTyp
}
BigDecimal result = bigDecimal.setScale(sTarget, RoundingMode.HALF_UP)
.round(new MathContext(pTarget, RoundingMode.HALF_UP));
logger.info("getDecimalLiteral orig bigDecimal: " + bigDecimal
+ ", targetType: " + targetType + ", result big decimal: " + result);
if (targetType.isDecimalV2Type()) {
return new DecimalLiteral((DecimalV2Type) targetType, result);
} else {
Expand Down
Loading