ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy Setrakyan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-4574) Introduce user value types to H2 w/custom conversion logic
Date Fri, 03 Mar 2017 16:51:45 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-4574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894704#comment-15894704
] 

Dmitriy Setrakyan commented on IGNITE-4574:
-------------------------------------------

Sergey, is this something that a user will ever have to implement or is it only an internal
interface?

> Introduce user value types to H2 w/custom conversion logic
> ----------------------------------------------------------
>
>                 Key: IGNITE-4574
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4574
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Alexander Paschenko
>            Assignee: Sergey Kalashnikov
>             Fix For: 2.0
>
>
> We need a way to add custom data types in H2 without the need to modify it each time
around.
> Current approach is to add new interface to H2 like the following:
> {code}
> public interface CustomDataTypesHandler {
>     DataType getDataTypeByName(String name);
>     DataType getDataTypeById(int type);
>     int getDataTypeOrder(int type);
>     Value convert(Value source, int targetType);
> }
> {code}
> The H2 will instantiate the class implementing the interface by its name provided by
user via system properties.
> Then, whenever H2 meets the SQL command with type name missing from its internal type
system, it will consult this new interface. 
> Likewise, whenever H2 needs to convert a value to unknown data type, it will delegate
the conversion to the CustomDataTypesHandler.
> The ignite will then implement this interface and be able to plug-in support for custom
types like enum, etc.
> Since convert operation returns object of type Value, all the possible operations in
custom datatypes can be overriden in a way we like.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message