gokceni commented on code in PR #1413:
URL: https://github.com/apache/phoenix/pull/1413#discussion_r848780886
##########
phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java:
##########
@@ -232,7 +232,15 @@ public static void serialize(PTable dataTable,
ImmutableBytesWritable ptr,
}
int nIndexes = indexes.size();
if (dataTable.getTransformingNewTable() != null) {
- nIndexes++;
+ boolean disabled =
dataTable.getTransformingNewTable().getIndexState()!= null &&
+
dataTable.getTransformingNewTable().getIndexState().isDisabled();
+ if (disabled && nIndexes == 0) {
+ ptr.set(ByteUtil.EMPTY_BYTE_ARRAY);
+ return;
+ }
+ if (!disabled) {
+ nIndexes++;
Review Comment:
We are reusing index maintainer code path and TransformMaintainer is the
subclass of IndexMaintainer. So, we are treating it as an index.
##########
phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java:
##########
@@ -248,11 +256,15 @@ public static void serialize(PTable dataTable,
ImmutableBytesWritable ptr,
output.write(protoBytes);
}
if (dataTable.getTransformingNewTable() != null) {
- ServerCachingProtos.TransformMaintainer proto =
TransformMaintainer.toProto(
-
dataTable.getTransformingNewTable().getTransformMaintainer(dataTable,
connection));
- byte[] protoBytes = proto.toByteArray();
- WritableUtils.writeVInt(output, protoBytes.length);
- output.write(protoBytes);
+ boolean disabled =
dataTable.getTransformingNewTable().getIndexState()!= null &&
Review Comment:
yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]