IGNITE-16376: Sql. Add UUID custom data type.#1623
Conversation
f957df4 to
559e02f
Compare
| /** | ||
| * Tests for {@link org.apache.ignite.internal.sql.engine.type.UuidType} data type. | ||
| */ | ||
| public class ItUuidTest extends AbstractBasicIntegrationTest { |
There was a problem hiding this comment.
will e good to add tests with UUID as Primary Key
There was a problem hiding this comment.
There are such tests in ItPublicApiColocationTest::colocationOneColumn
...-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/RexToLixTranslator.java
Outdated
Show resolved
Hide resolved
Adds UUID data type.
...ine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlToRelConvertor.java
Outdated
Show resolved
Hide resolved
…l/engine/prepare/IgniteSqlToRelConvertor.java Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com>
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Outdated
Show resolved
Hide resolved
…l/engine/type/IgniteCustomType.java Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com>
fix checkstyle errors.
| (short) typeNullable, false, (short) typeSearchable, false, false, false, "LONGVARBINARY", 0, 0, | ||
| Types.LONGVARBINARY, 0, null)); | ||
|
|
||
| types.add(Arrays.asList("UUID", Types.OTHER, ColumnMetadata.UNDEFINED_PRECISION, "'", "'", null, |
There was a problem hiding this comment.
seems we need additional test here ItJdbcMetadataSelfTest ?
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItUuidTest.java
Show resolved
Hide resolved
| assertQuery("SELECT ? = ?").withParams(uuid1, uuid2).returns(false).check(); | ||
| assertQuery("SELECT ? != ?").withParams(uuid1, uuid2).returns(true).check(); | ||
|
|
||
| assertQuery("SELECT ? > ?").withParams(uuid2, uuid1).returns(false).check(); |
There was a problem hiding this comment.
| assertQuery("SELECT ? > ?").withParams(uuid2, uuid1).returns(false).check(); | |
| assertQuery("SELECT ? > ?").withParams(uuid2, uuid1).returns(false).check(); | |
| assertQuery("SELECT ? > ?").withParams(uuid1, uuid2).returns(true).check(); |
There was a problem hiding this comment.
I have added additional checks that include for_less then and less_then_or_equals operators.
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/ItSqlLogicTest.java
Outdated
Show resolved
Hide resolved
...sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/exp/RexExecutorImpl.java
Show resolved
Hide resolved
| return Period.of((Integer) val / 12, (Integer) val % 12, 0); | ||
| } else if (storageType == byte[].class && val instanceof ByteString) { | ||
| return ((ByteString) val).getBytes(); | ||
| } else if (storageType == UUID.class) { |
There was a problem hiding this comment.
do we need it just for assertion check and if so - is assertion is enough here?
There was a problem hiding this comment.
It is not sufficient because else branch is called for all other type/value combinations.
And if guard for UUID tests that a value of UUID data type is UUID and nothing else.
...s/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteTypeFactory.java
Outdated
Show resolved
Hide resolved
...s/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteTypeFactory.java
Outdated
Show resolved
Hide resolved
...s/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteTypeFactory.java
Show resolved
Hide resolved
+ binary comparison checks
...e/src/test/java/org/apache/ignite/internal/sql/engine/prepare/LeastRestrictiveTypesTest.java
Show resolved
Hide resolved
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc/JdbcDatabaseMetadata.java
Outdated
Show resolved
Hide resolved
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/IgniteResource.java
Outdated
Show resolved
Hide resolved
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Outdated
Show resolved
Hide resolved
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Outdated
Show resolved
Hide resolved
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Outdated
Show resolved
Hide resolved
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Show resolved
Hide resolved
...es/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/IgniteCustomType.java
Outdated
Show resolved
Hide resolved
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/type/UuidFunctions.java
Outdated
Show resolved
Hide resolved
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItUuidTest.java
Outdated
Show resolved
Hide resolved
fix javadoc, add generic.
add custom type family
remove custom type family because it breaks casts.
Remove redundant method from IgniteResource.
Code style. check styles.
Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com> Co-authored-by: korlov42 <korlov@gridgain.com>
Co-authored-by: Andrew V. Mashenkov <AMashenkov@users.noreply.github.com> Co-authored-by: korlov42 <korlov@gridgain.com>
Adds UUID type.