ignite-issues mailing list archives

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

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

Sergey Kalashnikov commented on IGNITE-4574:

Dmitriy, this is an internal interface that Ignite would internally implement. It will not
be exposed to Ignite users.

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

View raw message