You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2024/09/05 06:31:00 UTC
[jira] [Commented] (IGNITE-19701) Type exception on insert into uuid columns with gen_random_uuid
[ https://issues.apache.org/jira/browse/IGNITE-19701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879443#comment-17879443 ]
Konstantin Orlov commented on IGNITE-19701:
-------------------------------------------
Due to historical reason {{gen_random_uuid}} returns VARCHAR value rather UUID, therefore expected result should be VALIDATION error on DDL because as of now we don't support implicit cast in DDL, and VARCHAR value cannot be assigned to UUID column. This validation has been added in IGNITE-19103. The very same patch removes {{gen_random_uuid}} at all, because we have better alternative {{rand_uuid}} that returns UUID value.
Given that said, the reproducer should be changed as follow:
{code}
create table tdd(a uuid default rand_uuid, b int, primary key (a) );
insert into tdd(b) values(22);
{code}
[~Berkov], could you confirm that it works as expected now?
> Type exception on insert into uuid columns with gen_random_uuid
> ---------------------------------------------------------------
>
> Key: IGNITE-19701
> URL: https://issues.apache.org/jira/browse/IGNITE-19701
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 3.0
> Reporter: Alexander Belyak
> Assignee: Konstantin Orlov
> Priority: Major
> Labels: ignite-3
>
> Step to reproduce:
> {noformat}
> create table tdd(a uuid default gen_random_uuid, b int, primary key (a) );
> insert into tdd(b) values(22)
> {noformat}
> Expected result: row with autogenerated primary key a inserted
> Actual result:
> {noformat}
> [Code: 0, SQL State: 50000] Exception while executing query [query=insert into tdd(b) values(22)]. Error message:Query remote fragment execution failed: nodeName=DropColumnsTest_cluster_1, queryId=e0a9b944-74a5-4d9d-a4a9-7962cb821c81, fragmentId=20, originalMessage=storageType is class java.util.UUID value must also be class java.util.UUID but it was: 1726917f-f47f-4ccc-94a0-59ac518e101b{noformat}
> It is possibly to insert row with generated UUID:
> {noformat}
> insert into tdd(a, b) values('1726917f-f47f-4ccc-94a0-59ac518e101b', 22){noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)