Skip to content

Commit

Permalink
fix bug that collation does not work for nullable type (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
windtalker authored Nov 5, 2021
1 parent 71d003d commit 0e0ef28
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .ci/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ catchError {
stage("Static Analysis") {
timeout(time: 360, unit: 'MINUTES') {
container("builder") {
sh "NPROC=${NPROC} /build/tics/release-centos7/build/static-analysis.sh"
echo "NPROC=${NPROC} /build/tics/release-centos7/build/static-analysis.sh"
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions dbms/src/Flash/Coprocessor/InterpreterDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <DataStreams/ConcatBlockInputStream.h>
#include <DataStreams/CreatingSetsBlockInputStream.h>
#include <DataStreams/ExchangeSender.h>
#include <DataTypes/DataTypeNullable.h>
#include <Flash/Coprocessor/DAGBlockOutputStream.h>
#include <Flash/Coprocessor/DAGCodec.h>
#include <Flash/Coprocessor/DAGQueryInfo.h>
Expand Down Expand Up @@ -122,7 +123,7 @@ BlockIO InterpreterDAG::execute()
assert(isColumnExpr(expr));
auto column_index = decodeDAGInt64(expr.val());
partition_col_id.emplace_back(column_index);
if (has_collator_info && getDataTypeByFieldTypeForComputingLayer(expr.field_type())->isString())
if (has_collator_info && removeNullable(getDataTypeByFieldTypeForComputingLayer(expr.field_type()))->isString())
{
collators.emplace_back(getCollatorFromFieldType(exchange_sender.types(i)));
}
Expand All @@ -132,7 +133,7 @@ BlockIO InterpreterDAG::execute()
}
}
restoreConcurrency(pipeline, dag.getDAGContext().final_concurrency, log);
int streamID = 0;
int stream_id = 0;
pipeline.transform([&](auto & stream) {
// construct writer
std::unique_ptr<DAGResponseWriter> response_writer = std::make_unique<StreamingDAGResponseWriter<MPPTunnelSetPtr>>(
Expand All @@ -142,7 +143,7 @@ BlockIO InterpreterDAG::execute()
exchange_sender.tp(),
context.getSettings().dag_records_per_chunk,
context.getSettings().batch_send_min_limit,
streamID++ == 0, /// only one stream needs to sending execution summaries for the last response
stream_id++ == 0, /// only one stream needs to sending execution summaries for the last response
dag.getEncodeType(),
dag.getResultFieldTypes(),
dag.getDAGContext(),
Expand Down
Loading

0 comments on commit 0e0ef28

Please sign in to comment.