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

Function CreateDecimalLiteral

be/src/exprs/expr-codegen-test.cc:200–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200TExprNode CreateDecimalLiteral(int precision, int scale) {
201 TScalarType scalar_type;
202 scalar_type.type = TPrimitiveType::DECIMAL;
203 scalar_type.__set_precision(precision);
204 scalar_type.__set_scale(scale);
205
206 TTypeNode type;
207 type.type = TTypeNodeType::SCALAR;
208 type.__set_scalar_type(scalar_type);
209
210 TColumnType col_type;
211 col_type.__set_types(vector<TTypeNode>(1, type));
212
213 TDecimalLiteral decimal_literal;
214 decimal_literal.value = "\1";
215
216 TExprNode expr;
217 expr.node_type = TExprNodeType::DECIMAL_LITERAL;
218 expr.type = col_type;
219 expr.num_children = 0;
220 expr.__set_decimal_literal(decimal_literal);
221 return expr;
222}
223
224// len > 0 => char
225TExprNode CreateStringLiteral(int len = -1) {

Callers 1

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected