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

Function CodegenAnyValToReadWriteInfo

be/src/runtime/descriptors.cc:1027–1072  ·  view source on GitHub ↗

Create a 'CodegenAnyValReadWriteInfo' but without creating basic blocks for null handling as this function should only be called if we assume that the value is not null.

Source from the content-addressed store, hash-verified

1025// handling as this function should only be called if we assume that the value is not
1026// null.
1027CodegenAnyValReadWriteInfo CodegenAnyValToReadWriteInfo(CodegenAnyVal& any_val,
1028 llvm::Value* pool_val) {
1029 CodegenAnyValReadWriteInfo rwi(any_val.codegen(), any_val.builder(), any_val.type());
1030
1031 switch (rwi.type().type) {
1032 case TYPE_STRING:
1033 case TYPE_VARCHAR:
1034 case TYPE_ARRAY: // CollectionVal has same memory layout as StringVal.
1035 case TYPE_MAP: { // CollectionVal has same memory layout as StringVal.
1036 rwi.SetPtrAndLen(any_val.GetPtr(), any_val.GetLen());
1037 break;
1038 }
1039 case TYPE_CHAR:
1040 rwi.SetPtrAndLen(any_val.GetPtr(), rwi.codegen()->GetI32Constant(rwi.type().len));
1041 break;
1042 case TYPE_FIXED_UDA_INTERMEDIATE:
1043 DCHECK(false) << "FIXED_UDA_INTERMEDIATE does not need to be copied: the "
1044 << "StringVal must be set up to point to the output slot";
1045 break;
1046 case TYPE_TIMESTAMP: {
1047 rwi.SetTimeAndDate(any_val.GetTimeOfDay(), any_val.GetDate());
1048 break;
1049 }
1050 case TYPE_BOOLEAN:
1051 case TYPE_TINYINT:
1052 case TYPE_SMALLINT:
1053 case TYPE_INT:
1054 case TYPE_BIGINT:
1055 case TYPE_FLOAT:
1056 case TYPE_DOUBLE:
1057 case TYPE_DECIMAL:
1058 case TYPE_DATE:
1059 // The representations of the types match - just store the value.
1060 rwi.SetSimpleVal(any_val.GetVal());
1061 break;
1062 case TYPE_STRUCT:
1063 DCHECK(false) << "Invalid type for this function. "
1064 << "Call 'StoreStructToNativePtr()' instead.";
1065 break;
1066 default:
1067 DCHECK(false) << "NYI: " << rwi.type().DebugString();
1068 break;
1069 }
1070
1071 return rwi;
1072}
1073
1074void SlotDescriptor::CodegenStoreNonNullAnyVal(CodegenAnyVal& any_val,
1075 llvm::Value* raw_val_ptr, llvm::Value* pool_val,

Calls 13

SetPtrAndLenMethod · 0.80
GetLenMethod · 0.80
GetI32ConstantMethod · 0.80
SetTimeAndDateMethod · 0.80
GetTimeOfDayMethod · 0.80
GetDateMethod · 0.80
SetSimpleValMethod · 0.80
codegenMethod · 0.45
builderMethod · 0.45
typeMethod · 0.45
GetPtrMethod · 0.45
GetValMethod · 0.45

Tested by

no test coverage detected