Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Nov 16, 2024
1 parent 37101f4 commit 441c27b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
import org.apache.doris.thrift.TQueryOptions;

import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.protobuf.ByteString;
import org.apache.thrift.TException;
import org.apache.thrift.TSerializer;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;

Expand All @@ -56,19 +58,16 @@ public class ShortCircuitQueryContext {
public final Queriable analzyedQuery;
// Serialized mysql Field, this could avoid serialize mysql field each time sendFields.
// Since, serialize fields is too heavy when table is wide
List<byte[]> serializedFields = new ArrayList();
Map<Interger, byte[]> serializedFields = Maps.newHashMap();

List<Type> returnTypes = null;

public byte[] getSerializedField(int idx) {
if (idx < serializedFields.size()) {
return serializedFields.get(idx);
}
return null;
return serializedFields.getOrDefault(idx, null);
}

public void addSerializedField(byte[] serializedField) {
serializedFields.add(serializedField);
public void addSerializedField(int idx, byte[] serializedField) {
serializedFields.put(idx, serializedField);
}

List<Type> getReturnTypes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2871,7 +2871,7 @@ private void sendFields(List<String> colNames, List<FieldInfo> fieldInfos, List<
serializer.writeField(colNames.get(i), types.get(i));
}
serializedField = serializer.toArray();
ctx.addSerializedField(serializedField);
ctx.addSerializedField(i, serializedField);
}
context.getMysqlChannel().sendOnePacket(ByteBuffer.wrap(serializedField));
} else {
Expand Down

0 comments on commit 441c27b

Please sign in to comment.