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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItUuidTest.java:
##########
@@ -0,0 +1,257 @@
+/*
+ * 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() {
+        dropAllTables();
+    }
+
+    @BeforeAll
+    public void createTables() {
+        sql("CREATE TABLE t(id INTEGER PRIMARY KEY, uuid_key UUID)");
+    }
+
+    @BeforeEach
+    public void cleanTables() {
+        sql("DELETE FROM t");
+    }
+
+    @Test
+    public void testUuidLiterals() {
+        UUID uuid1 = UUID.randomUUID();
+
+        assertQuery(String.format("SELECT CAST('%s' as UUID)", 
uuid1)).columnTypes(UUID.class).returns(uuid1).check();

Review Comment:
   Done.



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