[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-01-17 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-16115:
-

[~amashenkov] Yes, we should add methods like `getNullableAndXxx()`. `getAll` 
result could be used with `getOrDefault` and `contains` so using 
`NullableValue` in the returned map is redundant.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-01-28 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

[~agura] done.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-02-04 Thread Taras Ledkov (Jira)


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

Taras Ledkov commented on IGNITE-16115:
---

[~amashenkov], looks like the patch doesn't contain fix for client. Please file 
a ticket to support {{NullableValue}} for ignite-client.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-02-07 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

I'll make a separate ticket to fix the client once we will have a consensus on 
the methods contracts.
The main goal here is to fix the public API and test methods contracts.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-03-17 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

[~ptupitsyn], I’ve made changes that looks harmless at first glance, and got 
most of .Net tests broken.
Seems, all the tests failed on “tearDown” phase, when cache is cleaning up.
The reason looks weird: no schema with version=2 found.

I didn’t do any chages related to schema registration, or in binary protocol 
that could lead it.
Could you please take a look if there is an issue in platform client or in 
tests?

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-03-17 Thread Pavel Tupitsyn (Jira)


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

Pavel Tupitsyn commented on IGNITE-16115:
-

[~amashenkov] the stack trace is:
{code}
"ForkJoinPool.commonPool-worker-13@5418" daemon prio=5 tid=0xe1 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
  at 
org.apache.ignite.internal.schema.registry.SchemaRegistryImpl.schema(SchemaRegistryImpl.java:105)
  at 
org.apache.ignite.internal.schema.registry.SchemaRegistryImpl.resolveMapping(SchemaRegistryImpl.java:215)
  at 
org.apache.ignite.internal.schema.registry.SchemaRegistryImpl.resolveInternal(SchemaRegistryImpl.java:188)
  at 
org.apache.ignite.internal.schema.registry.SchemaRegistryImpl.resolve(SchemaRegistryImpl.java:148)
  at 
org.apache.ignite.internal.table.RecordBinaryViewImpl$$Lambda$762.83299136.apply(Unknown
 Source:-1)
  at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
  at 
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
  at 
java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
  at 
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
  at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
  at 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
  at 
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  at 
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
  at 
org.apache.ignite.internal.table.RecordBinaryViewImpl.wrap(RecordBinaryViewImpl.java:374)
  at 
org.apache.ignite.internal.table.RecordBinaryViewImpl$$Lambda$746.1221733526.apply(Unknown
 Source:-1)
  at 
java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
  at 
java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
  at 
java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610)
  at 
java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
  at 
java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
  at 
java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:290)
  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:-1)
  at 
java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
  at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
  at 
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
{code}

The client seems to behave correctly. There is only 1 schema with ID=1, that is 
sent with DeleteAll request.
Then the following line in *SchemaRegistryImpl#resolveMapping* is called: 
*mapping = schema(rowSchema.version() + 1).columnMapping();*
There is no schema with ID=2, so there is an exception.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-03-17 Thread Pavel Tupitsyn (Jira)


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

Pavel Tupitsyn commented on IGNITE-16115:
-

You can debug Java code with .NET tests:
* Install [.NET Core 3.1 
SDK|https://dotnet.microsoft.com/en-us/download/dotnet/3.1]
* Run PlatformTestNodeRunner from IDEA with debugger
* In *modules/platforms/dotnet*, run *dotnet test --filter 
TestConnectAndSendRequestReturnsResponse*

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-03-17 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

[~ptupitsyn] Thanks a lot for your time!

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2022-03-17 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

[~agura] please, review once again.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha5
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2021-12-15 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

Null-values are not allowed for KV binary view by design.
Does it make sense to implement getNullable(K) method or add a stub throwing 
e.g. an UnsupportedOperationException?

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha4
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce NullableValue class-wrapper for a value and implement 
> getNullable, and getOrDefault methods for that purpose.
> The first one is useful for cases, when it's not possible to use a "default", 
> but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
> * return {{null}} if the table has no row for the key.
> * return a non-null value for the key.
> * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2021-12-15 Thread Yury Gerzhedovich (Jira)


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

Yury Gerzhedovich commented on IGNITE-16115:


[~agura] could you please reviw the patch, it LGTM, however I would like some 
attention from you.

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha4
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce NullableValue class-wrapper for a value and implement 
> getNullable, and getOrDefault methods for that purpose.
> The first one is useful for cases, when it's not possible to use a "default", 
> but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
> * return {{null}} if the table has no row for the key.
> * return a non-null value for the key.
> * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2021-12-20 Thread Andrey N. Gura (Jira)


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

Andrey N. Gura commented on IGNITE-16115:
-

[~amashenkov]I've reviewed the PR and have some comments. Could you please take 
a look?

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha4
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce NullableValue class-wrapper for a value and implement 
> getNullable, and getOrDefault methods for that purpose.
> The first one is useful for cases, when it's not possible to use a "default", 
> but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
> * return {{null}} if the table has no row for the key.
> * return a non-null value for the key.
> * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (IGNITE-16115) Implement getNullable and getOrDefault operations.

2021-12-21 Thread Andrey Mashenkov (Jira)


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

Andrey Mashenkov commented on IGNITE-16115:
---

[~agura] , I've fixed all the comments.

Seems, we've foget {{getAndPut()/getAndRemove()/getAndReplace()/getAll()}} 
methods.
Also, AFAIK, {{getAll()}} will return Map after IGNITE-16004, and Map has 
{{getOrDefault()}} and {{contains()}} methods.
Should they have adjacents with similar nullable semantic as getNullable? WDYT?

> Implement getNullable and getOrDefault operations.
> --
>
> Key: IGNITE-16115
> URL: https://issues.apache.org/jira/browse/IGNITE-16115
> Project: Ignite
>  Issue Type: Improvement
>Reporter: Andrey Mashenkov
>Assignee: Andrey Mashenkov
>Priority: Major
>  Labels: ignite-3
> Fix For: 3.0.0-alpha4
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> It is allowed to map an object to a single nullable column, which makes 
> 'null' values legal in the KeyValue view.
> Once the 'null' value is possible there is no way to distinguish, if there is 
> no row in a table for the given key, or the row exists and the mapped column 
> contains the 'null' value.
> Let's introduce {{NullableValue}} class-wrapper for a value and implement 
> {{{}getNullable(){}}}, and {{getOrDefault()}} + bulk methods.
> {{getNullable()}} is useful for cases, when it's not possible to use a 
> "default", but creates an additional wrapper.
> Also, the KeyValueView.get(key) method behavior should be changed:
>  * return {{null}} if the table has no row for the key.
>  * return a non-null value for the key.
>  * fail with a suggestion to use a getNullable, if a {{null}} value returned 
> for the key to avoid ambiguity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)