[
https://issues.apache.org/jira/browse/IGNITE-5648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16110781#comment-16110781
]
Vladimir Ozerov commented on IGNITE-5648:
-----------------------------------------
[~skalashnikov], my comments:
1) {{org.apache.ignite.internal.processors.query.GridQueryProperty#validate}} -
docs say that exception is thrown if validation against some constraints has
failed. Why none implementations of this method check for {{notNull}} flag
then? Looks like this is a wrong abstraction. Instead, we should move this
logic to
{{org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl#validateKeyAndValue}}.
2) {{org.apache.ignite.internal.processors.query.GridQueryProperty#setValue}} -
there are duplicated null check in both implementations. Isn't it too late to
check for null when this method is called? This method is called from two
places - one in DML statement and one deep inside the cache. I think null check
must be performed only in DML processor as a separate routine, and should not
be called in indexing internals (H2RowDescriptor) for the sake of performance.
Makes sense?
3) {{QueryUtils}} - code style violations (too long strings, incorrect indents)
4) Note that neither key, not value as a whole can ever be null already.
5) {{QueryTypeDescriptorImpl}} - unused imports and fields
6) {{GridNearAtomicUpdateFuture}} and it's "single" brother - why do we skip
{{TRANSFORM}} case? {{EntryProcessor}} can easily produce invalid values, and
we must check them as well. Please confirm that it is covered in some other
place.
7) I am concerned about {{GridCacheContext#validateKeyAndValue}} performance.
We need to think on some quick exit path in case queries are not enabled for
cache (no {{QueryEntitiy}} in config), or there are no null-constrained
columns. Ideally it should be some volatile boolean flag which is checked
first.
> NOT NULL constraint support for CREATE TABLE operator
> -----------------------------------------------------
>
> Key: IGNITE-5648
> URL: https://issues.apache.org/jira/browse/IGNITE-5648
> Project: Ignite
> Issue Type: New Feature
> Components: sql
> Affects Versions: 2.0
> Reporter: Denis Magda
> Assignee: Sergey Kalashnikov
> Fix For: 2.3
>
>
> This is an umbrella ticket intended to aggregate all the activities related
> to {{NOT NULL}} constraint support for {{CREATE TABLE}} commands.
> {code}
> CREATE TABLE legs(legid INT NOT NULL);
> {code}
> Ignite must prevent setting {{legid}} to {{null}} value.
> The feature has to be supported for:
> * ODBC and JDBC drivers.
> * Native APIs (Java, .NET, C++)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)