MCPcopy Create free account
hub / github.com/apache/impala / DecimalDecimalTest

Method DecimalDecimalTest

be/src/util/tuple-row-compare-test.cc:240–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238
239 template<typename DECIMAL_T>
240 int DecimalDecimalTest(int64_t lval1, int64_t lval2, int64_t rval1, int64_t rval2,
241 int precision, int scale) {
242 ColumnType decimal_column = ColumnType::CreateDecimalType(precision, scale);
243 CreateComperator(decimal_column, decimal_column);
244 bool overflow = false;
245 DECIMAL_T l1 = DECIMAL_T::FromInt(precision, scale, lval1, &overflow);
246 DECIMAL_T l2 = DECIMAL_T::FromInt(precision, scale, lval2, &overflow);
247 DECIMAL_T r1 = DECIMAL_T::FromInt(precision, scale, rval1, &overflow);
248 DECIMAL_T r2 = DECIMAL_T::FromInt(precision, scale, rval2, &overflow);
249 TupleRow* lhs = CreateTupleRow(l1, l2);
250 TupleRow* rhs = CreateTupleRow(r1, r2);
251 int result = comperator_->Compare(lhs, rhs);
252 comperator_->Close(runtime_state_);
253 return result;
254 }
255
256 // The number of bytes to compare in a string depends on the size of the types present
257 // in a row. If there are only strings present, only the first 4 bytes will be

Callers

nothing calls this directly

Calls 2

CompareMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected