Re: Warning if no table for BinaryObject

2017-09-28 Thread Mikhail Cherkasov
Hi Denis,

I filed a ticket: https://issues.apache.org/jira/browse/IGNITE-6528

Thanks,
Mikhail.

On Tue, Sep 26, 2017 at 6:58 PM, Denis Magda  wrote:

> Mikhail,
>
> Could you prepare a properly described ticket encompassing the suggested
> warning? Let’s do the improvement for the upcoming release.
>
> —
> Denis
>
> > On Sep 26, 2017, at 7:23 AM, Mikhail Cherkasov 
> wrote:
> >
> > Hi Dmitry,
> >
> > The problem is that we don't have strong typing when defining QueryEntriy
> > and a user can use an arbitrary string id to
> > define a type, but he should use the same string id to obtain binary
> object
> > builder, however, people sometimes confusing this.
> > So the user can define QueryEntity with value type:
> > queryEntity.setValueType("MyCoolName") and
> > later put to cache the following binary object:
> > ignite.binary.toBinary(value), but this object won't be indexed, because
> > ignite.binary.toBinary uses class name as string id while indexing
> expects
> > to find "MyCoolName" as id.
> >
> > There's no bug in ignite about this, but I think the warning can make
> > users' life easy and
> > make ignite configuration more friendly to new users.
> >
> > Thanks,
> > Mikhail.
> >
> >
> >
> >
> > On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov 
> wrote:
> >
> >> Pavel, we can optionally enforce that, but not by default.
> >>
> >> Dmitry, the problem is the following. User configures Ignite cache and
> >> query entity, does several puts than empty results for SQL. The reason
> is
> >> very simple - typo in class name or simply different classes in
> >> configuration and of actual cache entry. The fix is pretty simple and
> make
> >> product more usable.
> >>
> >> --Yakov
> >>
> >
> >
> >
> > --
> > Thanks,
> > Mikhail.
>
>


-- 
Thanks,
Mikhail.


[jira] [Created] (IGNITE-6528) Warning if no table for BinaryObject

2017-09-28 Thread Mikhail Cherkasov (JIRA)
Mikhail Cherkasov created IGNITE-6528:
-

 Summary: Warning if no table for BinaryObject
 Key: IGNITE-6528
 URL: https://issues.apache.org/jira/browse/IGNITE-6528
 Project: Ignite
  Issue Type: Improvement
  Components: binary, cache, sql
Reporter: Mikhail Cherkasov


I've seen several times that due wrong cache configuration people can't find 
data in cache and blame Ignite that it's buggy and doesn't work.

And it's very difficult to find an error in the code, especially if you don't 
have reach experience with Ignite.

The problem is that we don't have strong typing when defining QueryEntriy and a 
user can use an arbitrary string id to
define a type, but he should use the same string id to obtain binary object 
builder, however, people sometimes confusing this.
So the user can define QueryEntity with value type:  
queryEntity.setValueType("MyCoolName") and 
later put to cache the following binary object: ignite.binary.toBinary(value), 
but this object won't be indexed, because
ignite.binary.toBinary uses class name as string id while indexing expects to 
find "MyCoolName" as id.

The example is simple and the error is obvious when you see this two lines 
close to each other, however, in real life, cache definition and data ingestion 
are separated by tons of code.

We can save a lot of man-hours for our users if Ignite will print a warning If 
a cache has a configured QE and user puts BinaryObject with typeName which 
doesn't correspond to any QE.

The warning should be printed only once, something like:
[WARN] No table is found for %typeName% binary object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


Re: Warning if no table for BinaryObject

2017-09-26 Thread Denis Magda
Mikhail,

Could you prepare a properly described ticket encompassing the suggested 
warning? Let’s do the improvement for the upcoming release.

—
Denis

> On Sep 26, 2017, at 7:23 AM, Mikhail Cherkasov  
> wrote:
> 
> Hi Dmitry,
> 
> The problem is that we don't have strong typing when defining QueryEntriy
> and a user can use an arbitrary string id to
> define a type, but he should use the same string id to obtain binary object
> builder, however, people sometimes confusing this.
> So the user can define QueryEntity with value type:
> queryEntity.setValueType("MyCoolName") and
> later put to cache the following binary object:
> ignite.binary.toBinary(value), but this object won't be indexed, because
> ignite.binary.toBinary uses class name as string id while indexing expects
> to find "MyCoolName" as id.
> 
> There's no bug in ignite about this, but I think the warning can make
> users' life easy and
> make ignite configuration more friendly to new users.
> 
> Thanks,
> Mikhail.
> 
> 
> 
> 
> On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov  wrote:
> 
>> Pavel, we can optionally enforce that, but not by default.
>> 
>> Dmitry, the problem is the following. User configures Ignite cache and
>> query entity, does several puts than empty results for SQL. The reason is
>> very simple - typo in class name or simply different classes in
>> configuration and of actual cache entry. The fix is pretty simple and make
>> product more usable.
>> 
>> --Yakov
>> 
> 
> 
> 
> -- 
> Thanks,
> Mikhail.



Re: Warning if no table for BinaryObject

2017-09-26 Thread Mikhail Cherkasov
Hi Dmitry,

The problem is that we don't have strong typing when defining QueryEntriy
and a user can use an arbitrary string id to
define a type, but he should use the same string id to obtain binary object
builder, however, people sometimes confusing this.
So the user can define QueryEntity with value type:
 queryEntity.setValueType("MyCoolName") and
later put to cache the following binary object:
ignite.binary.toBinary(value), but this object won't be indexed, because
ignite.binary.toBinary uses class name as string id while indexing expects
to find "MyCoolName" as id.

There's no bug in ignite about this, but I think the warning can make
users' life easy and
make ignite configuration more friendly to new users.

Thanks,
Mikhail.




On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov  wrote:

> Pavel, we can optionally enforce that, but not by default.
>
> Dmitry, the problem is the following. User configures Ignite cache and
> query entity, does several puts than empty results for SQL. The reason is
> very simple - typo in class name or simply different classes in
> configuration and of actual cache entry. The fix is pretty simple and make
> product more usable.
>
> --Yakov
>



-- 
Thanks,
Mikhail.


Re: Warning if no table for BinaryObject

2017-09-25 Thread Yakov Zhdanov
Pavel, we can optionally enforce that, but not by default.

Dmitry, the problem is the following. User configures Ignite cache and
query entity, does several puts than empty results for SQL. The reason is
very simple - typo in class name or simply different classes in
configuration and of actual cache entry. The fix is pretty simple and make
product more usable.

--Yakov


Re: Warning if no table for BinaryObject

2017-09-25 Thread Dmitriy Setrakyan
On Fri, Sep 22, 2017 at 9:47 AM, Mikhail Cherkasov 
wrote:

> Hi all,
>
> I've seen several times that due wrong cache configuration people can't
> find
> data in cache and blame Ignite that it's buggy and doesn't work.
>
> And it's very difficult to find an error in the code, especially if you
> don't have reach experience with Ignite.
>
> One of the very common case is that user specifys a name to QueryEntity
> value type:
> queryEntity.setValueType("MyCoolName")
> and later put data to cache like:
> ignite.binary.toBinary(value)
>
> The example is simple and the error is obvious when you see this two lines
> close to each other, however, in real life, cache definition and data
> ingestion are separated by tons of code.
>
>
Mikhail, the example may be simple and obvious to some, but not to most
(including me). Can you please explain what it is we are trying to solve?
What is wrong with the above code snippet?


Re: Warning if no table for BinaryObject

2017-09-25 Thread Pavel Tupitsyn
We could even add a configuration switch to throw an exception in such case.

I guess that in majority of use cases there is a single type per cache,
and we should have a way to enforce that.

On Fri, Sep 22, 2017 at 7:47 PM, Mikhail Cherkasov 
wrote:

> Hi all,
>
> I've seen several times that due wrong cache configuration people can't
> find
> data in cache and blame Ignite that it's buggy and doesn't work.
>
> And it's very difficult to find an error in the code, especially if you
> don't have reach experience with Ignite.
>
> One of the very common case is that user specifys a name to QueryEntity
> value type:
> queryEntity.setValueType("MyCoolName")
> and later put data to cache like:
> ignite.binary.toBinary(value)
>
> The example is simple and the error is obvious when you see this two lines
> close to each other, however, in real life, cache definition and data
> ingestion are separated by tons of code.
>
> We can save a lot of man-hours for our users if Ignite will print a warning
> If a cache has a configured QE and user puts BinaryObject with typeName
> which doesn't correspond to any QE.
>
> The warning should be printed only once, something like:
> [WARN] No table is found for %typeName% binary object.
>
> Thoughts?
>
>
> --
> Thanks,
> Mikhail.
>


Warning if no table for BinaryObject

2017-09-22 Thread Mikhail Cherkasov
Hi all,

I've seen several times that due wrong cache configuration people can't
find
data in cache and blame Ignite that it's buggy and doesn't work.

And it's very difficult to find an error in the code, especially if you
don't have reach experience with Ignite.

One of the very common case is that user specifys a name to QueryEntity
value type:
queryEntity.setValueType("MyCoolName")
and later put data to cache like:
ignite.binary.toBinary(value)

The example is simple and the error is obvious when you see this two lines
close to each other, however, in real life, cache definition and data
ingestion are separated by tons of code.

We can save a lot of man-hours for our users if Ignite will print a warning
If a cache has a configured QE and user puts BinaryObject with typeName
which doesn't correspond to any QE.

The warning should be printed only once, something like:
[WARN] No table is found for %typeName% binary object.

Thoughts?


-- 
Thanks,
Mikhail.