You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Jian Chen <ch...@gmail.com> on 2023/02/21 04:47:41 UTC

Fix incorrect date type insertion in sql component

Hi Igniters,

I want to fix https://issues.apache.org/jira/browse/IGNITE-7360 .
Currently, I plan to added a date validation function in class
"org.apache.ignite.internal.processors.query.calcite.util.TypeUtils" to
validate the value of date that comes from the methods:

   - toInternal
   - fromInternal
   - fromLiteral

Any suggestions?


Stephen

Re: Fix incorrect date type insertion in sql component

Posted by Jian Chen <ch...@gmail.com>.
Thank you Alex, understand that the behavior might different to make fully
compatible with sql standards, perhaps we can only constraint the write
process , both the api and sql components. Thus we can read even there are
some old date in the database already

Yours
Stephen

Alex Plehanov <pl...@gmail.com>于2023年2月27日 周一下午3:49写道:

> Hello, Jian Chen
>
> In Ignite date values can also be inserted by KV API, so year stored in the
> database can be outside of valid SQL standard range (0001-9999). If such
> values will be prohibited inside the "toInternal" method, there can be
> unexpected exceptions on select from the database. Some pure SQL databases
> (for example, PostgreSQL) do not have such limitation, perhaps we also can
> live without it, especially when "invalid" values can be inserted via KV
> API.
>
>
> вт, 21 февр. 2023 г. в 07:48, Jian Chen <ch...@gmail.com>:
>
> > Hi Igniters,
> >
> > I want to fix https://issues.apache.org/jira/browse/IGNITE-7360 .
> > Currently, I plan to added a date validation function in class
> > "org.apache.ignite.internal.processors.query.calcite.util.TypeUtils" to
> > validate the value of date that comes from the methods:
> >
> >    - toInternal
> >    - fromInternal
> >    - fromLiteral
> >
> > Any suggestions?
> >
> >
> > Stephen
> >
>

Re: Fix incorrect date type insertion in sql component

Posted by Alex Plehanov <pl...@gmail.com>.
Hello, Jian Chen

In Ignite date values can also be inserted by KV API, so year stored in the
database can be outside of valid SQL standard range (0001-9999). If such
values will be prohibited inside the "toInternal" method, there can be
unexpected exceptions on select from the database. Some pure SQL databases
(for example, PostgreSQL) do not have such limitation, perhaps we also can
live without it, especially when "invalid" values can be inserted via KV
API.


вт, 21 февр. 2023 г. в 07:48, Jian Chen <ch...@gmail.com>:

> Hi Igniters,
>
> I want to fix https://issues.apache.org/jira/browse/IGNITE-7360 .
> Currently, I plan to added a date validation function in class
> "org.apache.ignite.internal.processors.query.calcite.util.TypeUtils" to
> validate the value of date that comes from the methods:
>
>    - toInternal
>    - fromInternal
>    - fromLiteral
>
> Any suggestions?
>
>
> Stephen
>