You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background:
When parsing 'numeric2=4', the following function will be entered:
org.apache.inlong.sdk.transform.process.operator.OperatorTools#compareValue()
publicstaticintcompareValue(Comparableleft, Comparableright) {
if (left == null) {
returnright == null ? 0 : -1;
}
if (right == null) {
return1;
}
/* When one of the left and right is a string, the other is assumed to be BigDecimal, but there are other types present during the parsing process. For example, here JSQLParser parses the 4 in the expression as a Long type, while numeric2 is parsed by the SDK as a string "4". In "ObjectUtils.compare()", an error occurs due to inconsistent types on both sides. */if (leftinstanceofString) {
if (rightinstanceofString) {
returnObjectUtils.compare(left, right);
} else {
BigDecimalleftValue = parseBigDecimal(left);
returnObjectUtils.compare(leftValue, right);
}
} else {
if (rightinstanceofString) {
BigDecimalrightValue = parseBigDecimal(right);
returnObjectUtils.compare(left, rightValue);
} else {
returnObjectUtils.compare(left, right);
}
}
}
Questions:
The Transform reserved a field type interface, but it was not used in subsequent development.
The compareValue method in OperatorTools did not take into account in detail the types involved in comparing the two instances.
Description
Data:
SQL Statement:
Background:
When parsing
'numeric2=4'
, the following function will be entered:Questions:
InLong Component
InLong SDK
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: