adelapena commented on code in PR #1739:
URL: https://github.com/apache/cassandra/pull/1739#discussion_r928753856


##########
src/java/org/apache/cassandra/cql3/selection/WritetimeOrTTLSelector.java:
##########
@@ -32,51 +32,57 @@
 import org.apache.cassandra.io.util.DataInputPlus;
 import org.apache.cassandra.io.util.DataOutputPlus;
 import org.apache.cassandra.transport.ProtocolVersion;
-import org.apache.cassandra.utils.ByteBufferUtil;
 
 final class WritetimeOrTTLSelector extends Selector
 {
-    protected static final SelectorDeserializer deserializer = new 
SelectorDeserializer()
+    static final SelectorDeserializer deserializer = new SelectorDeserializer()
     {
+        @Override
         protected Selector deserialize(DataInputPlus in, int version, 
TableMetadata metadata) throws IOException
         {
-            ByteBuffer columnName = ByteBufferUtil.readWithVIntLength(in);
-            ColumnMetadata column = metadata.getColumn(columnName);
+            Selector selected = serializer.deserialize(in, version, metadata);
             int idx = in.readInt();
             int ordinal = in.readByte();
-            Selectable.WritetimeOrTTL.Kind k = 
Selectable.WritetimeOrTTL.Kind.fromOrdinal(ordinal);
-            return new WritetimeOrTTLSelector(column, idx, k);
+            Selectable.WritetimeOrTTL.Kind kind = 
Selectable.WritetimeOrTTL.Kind.fromOrdinal(ordinal);
+            boolean isMultiCell = in.readBoolean();
+            return new WritetimeOrTTLSelector(selected, idx, kind, 
isMultiCell);
         }
     };
 
-    private final ColumnMetadata column;
-    private final int idx;
+    private final Selector selected;
+    private final int columnIndex;
     private final Selectable.WritetimeOrTTL.Kind kind;
     private ByteBuffer current;
+    private final boolean isMultiCell;
     private boolean isSet;
 
-    public static Factory newFactory(final ColumnMetadata def, final int idx, 
final Selectable.WritetimeOrTTL.Kind kind)
+    public static Factory newFactory(final Selector.Factory factory, final int 
columnIndex, final Selectable.WritetimeOrTTL.Kind kind, boolean isMultiCell)
     {
         return new Factory()
         {
+            @Override
             protected String getColumnName()
             {
-                return String.format("%s(%s)", kind.name, def.name.toString());
+                return String.format("%s(%s)", kind.name, 
factory.getColumnName());
             }
 
+            @Override
             protected AbstractType<?> getReturnType()
             {
-                return kind.returnType;
+                AbstractType<?> type = kind.returnType;
+                return isMultiCell && !kind.aggregatesMultiCell() ? 
ListType.getInstance(type, false) : type;
             }
 
+            @Override
             protected void addColumnMapping(SelectionColumnMapping mapping, 
ColumnSpecification resultsColumn)
             {
-               mapping.addMapping(resultsColumn, def);
+                factory.addColumnMapping(mapping, resultsColumn);

Review Comment:
   I think that the previous line was missing a heading space, and now it's 
properly aligned.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to