gianm commented on code in PR #12745:
URL: https://github.com/apache/druid/pull/12745#discussion_r917026986


##########
processing/src/main/java/org/apache/druid/frame/field/ComplexFieldWriter.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.frame.field;
+
+import org.apache.datasketches.memory.WritableMemory;
+import org.apache.druid.segment.BaseObjectColumnValueSelector;
+import org.apache.druid.segment.serde.ComplexMetricSerde;
+
+/**
+ * Wraps a {@link BaseObjectColumnValueSelector} and uses {@link 
ComplexMetricSerde#toBytes} to write complex objects.
+ */
+public class ComplexFieldWriter implements FieldWriter
+{
+  public static final byte NULL_BYTE = 0x00;

Review Comment:
   I added some comments about why they are this way.
   
   As to whether the field writers should/shouldn't have their own versions. I 
dunno. I thought it was cleaner and more self contained for each field writer 
to define its own constants, even if they ended up all being the same. I think 
sharing them would be fine too. I'd like to leave it this way since I don't 
think it makes a big difference.



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