lowka commented on code in PR #1623:
URL: https://github.com/apache/ignite-3/pull/1623#discussion_r1105670869


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItUuidTest.java:
##########
@@ -0,0 +1,261 @@
+/*
+ * 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.ignite.internal.sql.engine;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import java.util.Arrays;
+import java.util.UUID;
+import java.util.stream.Stream;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.ignite.lang.IgniteException;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
+/**
+ * Tests for {@link org.apache.ignite.internal.sql.engine.type.UuidType} data 
type.
+ */
+public class ItUuidTest extends AbstractBasicIntegrationTest {
+
+    // UUID1 > UUID2
+    private static final UUID UUID_1 = 
UUID.fromString("fd10556e-fc27-4a99-b5e4-89b8344cb3ce");
+
+    private static final UUID UUID_2 = 
UUID.fromString("c67d4baf-564e-4abe-aad5-fcf078d178bf");
+
+    /**
+     * Drops all created tables.
+     */
+    @AfterAll
+    public void dropTables() {

Review Comment:
   fixed



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteTypeFactory.java:
##########
@@ -376,6 +498,49 @@ private boolean allEquals(List<RelDataType> types) {
         return true;
     }
 
+    private static final class CustomDataTypes {
+
+        /**
+         * Contains java types used registered custom data types.
+         * We need those to throw errors to reject attempts to create custom 
data types via
+         * {@link IgniteTypeFactory#createType(Type)}/{@link 
IgniteTypeFactory#createJavaType(Class)}
+         * methods of {@link IgniteTypeFactory}.
+         */
+        private final Set<Type> javaTypes;
+
+        /**
+         * Stores functions that are being used by {@link 
#createCustomType(String, int)} to create type instances.
+         */
+        private final Map<String, MakeCustomType> typeConstructors;
+
+        CustomDataTypes(Set<NewCustomType> customDataTypes) {
+            this.javaTypes = customDataTypes.stream()
+                    .map(t -> t.storageType)
+                    .collect(Collectors.toSet());
+
+            this.typeConstructors = 
customDataTypes.stream().collect(Collectors.toMap((v) -> v.typeName, (v) -> 
v.makeType));
+        }
+    }
+
+    private static final class NewCustomType {

Review Comment:
   Fixed



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