mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Fixed Date, DateTime native type
This commit is contained in:
parent
16a07f61ae
commit
4db7e49ccf
@ -174,7 +174,7 @@ static inline llvm::Constant * getColumnNativeValue(llvm::IRBuilderBase & builde
|
|||||||
{
|
{
|
||||||
return llvm::ConstantFP::get(type, assert_cast<const ColumnVector<Float64> &>(column).getElement(index));
|
return llvm::ConstantFP::get(type, assert_cast<const ColumnVector<Float64> &>(column).getElement(index));
|
||||||
}
|
}
|
||||||
else if (column_data_type.isNativeUInt())
|
else if (column_data_type.isNativeUInt() || column_data_type.isDateOrDateTime())
|
||||||
{
|
{
|
||||||
return llvm::ConstantInt::get(type, column.getUInt(index));
|
return llvm::ConstantInt::get(type, column.getUInt(index));
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,13 @@ llvm::Value * CompileDAG::compile(llvm::IRBuilderBase & builder, Values input_no
|
|||||||
{
|
{
|
||||||
case CompileType::CONSTANT:
|
case CompileType::CONSTANT:
|
||||||
{
|
{
|
||||||
compiled_values[compiled_values_index] = getColumnNativeValue(b, node.result_type, *node.column, 0);
|
auto * native_value = getColumnNativeValue(b, node.result_type, *node.column, 0);
|
||||||
|
if (!native_value)
|
||||||
|
throw Exception(ErrorCodes::LOGICAL_ERROR,
|
||||||
|
"Cannot native value for constant column with type {}",
|
||||||
|
node.result_type->getName());
|
||||||
|
|
||||||
|
compiled_values[compiled_values_index] = native_value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CompileType::FUNCTION:
|
case CompileType::FUNCTION:
|
||||||
@ -47,7 +53,10 @@ llvm::Value * CompileDAG::compile(llvm::IRBuilderBase & builder, Values input_no
|
|||||||
temporary_values.reserve(node.arguments.size());
|
temporary_values.reserve(node.arguments.size());
|
||||||
|
|
||||||
for (auto argument_index : node.arguments)
|
for (auto argument_index : node.arguments)
|
||||||
|
{
|
||||||
|
assert(compiled_values[argument_index] != nullptr);
|
||||||
temporary_values.emplace_back(compiled_values[argument_index]);
|
temporary_values.emplace_back(compiled_values[argument_index]);
|
||||||
|
}
|
||||||
|
|
||||||
compiled_values[compiled_values_index] = node.function->compile(builder, temporary_values);
|
compiled_values[compiled_values_index] = node.function->compile(builder, temporary_values);
|
||||||
break;
|
break;
|
||||||
@ -95,8 +104,11 @@ std::string CompileDAG::dump() const
|
|||||||
for (auto argument_index : node.arguments)
|
for (auto argument_index : node.arguments)
|
||||||
function_dump += dumped_values[argument_index] += ", ";
|
function_dump += dumped_values[argument_index] += ", ";
|
||||||
|
|
||||||
|
if (!node.arguments.empty())
|
||||||
|
{
|
||||||
function_dump.pop_back();
|
function_dump.pop_back();
|
||||||
function_dump.pop_back();
|
function_dump.pop_back();
|
||||||
|
}
|
||||||
|
|
||||||
function_dump += ')';
|
function_dump += ')';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user