bodduv commented on code in PR #903:
URL: https://github.com/apache/arrow-java/pull/903#discussion_r2508339299


##########
vector/src/main/java/org/apache/arrow/vector/extension/UuidType.java:
##########
@@ -14,24 +14,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.arrow.vector.types.pojo;
+package org.apache.arrow.vector.extension;
 
 import org.apache.arrow.memory.BufferAllocator;
 import org.apache.arrow.vector.FieldVector;
 import org.apache.arrow.vector.FixedSizeBinaryVector;
 import org.apache.arrow.vector.UuidVector;
+import org.apache.arrow.vector.types.pojo.ArrowType;
 import org.apache.arrow.vector.types.pojo.ArrowType.ExtensionType;
+import org.apache.arrow.vector.types.pojo.ExtensionTypeRegistry;
+import org.apache.arrow.vector.types.pojo.FieldType;
 
 public class UuidType extends ExtensionType {

Review Comment:
   A short doc string mentioning UuidType as a canonical extension type could 
make it more readable.



##########
vector/src/main/java/org/apache/arrow/vector/extension/UuidType.java:
##########
@@ -14,24 +14,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.arrow.vector.types.pojo;
+package org.apache.arrow.vector.extension;
 
 import org.apache.arrow.memory.BufferAllocator;
 import org.apache.arrow.vector.FieldVector;
 import org.apache.arrow.vector.FixedSizeBinaryVector;
 import org.apache.arrow.vector.UuidVector;
+import org.apache.arrow.vector.types.pojo.ArrowType;
 import org.apache.arrow.vector.types.pojo.ArrowType.ExtensionType;
+import org.apache.arrow.vector.types.pojo.ExtensionTypeRegistry;
+import org.apache.arrow.vector.types.pojo.FieldType;
 
 public class UuidType extends ExtensionType {
+  public static final UuidType INSTANCE = new UuidType();
+
+  public static final String EXTENSION_NAME = "arrow.uuid";
+  public static final int UUID_BYTE_WIDTH = 16;
+  public static final int UUID_STRING_WIDTH = 36;
+  public static final ArrowType STORAGE_TYPE = new 
ArrowType.FixedSizeBinary(UUID_BYTE_WIDTH);
+
+  static {
+    ExtensionTypeRegistry.register(INSTANCE);
+  }

Review Comment:
   Should the same pattern be used as in `OpaqueType.ensureRegistered`?



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

Reply via email to