Issue with adding nested index dynamically

classic Classic list List threaded Threaded
47 messages Options
123
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hello Ivan, can you please check and provide updates on this



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

Could you bring a little bit more details about your problem?
I would like to see you java classes and QueryEntity configuration.
Ideally it would be to have a runnable reproducer (junit test or class
with main method).

Also I would like to realize how soon are you expecting a fix in Ignite release?
As far as I know next Ignite release is planned in the beginning of next year.

I tried following and it worked for me:

class User {
    String userName;
    Address address;

    public User(String userName, Address address) {
        this.userName = userName;
        this.address = address;
    }
}

class Address {
    String streetName;
    String zipcode;

    public Address(String streetName, String zipcode) {
        this.streetName = streetName;
        this.zipcode = zipcode;
    }
}

@Test
public void testSqlPojoWithoutAnnotations() throws Exception {
    IgniteEx grid = startGrid(0);

    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("userName", "String");
    fields.put("address.zipcode", "String");

    IgniteCache<Object, Object> cache = grid.createCache(new
CacheConfiguration<>(DEFAULT_CACHE_NAME)
        .setQueryEntities(Collections.singleton(new
QueryEntity(Integer.class, User.class)
            .setFields(fields))));

    cache.put(1, new User("ivan", new Address("a", "123")));

    System.err.println(cache.query(new SqlFieldsQuery("select * from
User")).getAll());

    System.err.println(cache.query(new SqlFieldsQuery("select zipcode
from User")).getAll());

    cache.query(new SqlFieldsQuery("create index on User(zipcode)"));

    System.err.println(cache.query(new SqlFieldsQuery("select zipcode
from User")).getAll());
}

ср, 16 окт. 2019 г. в 10:59, Hemambara <[hidden email]>:
>
> Hello Ivan, can you please check and provide updates on this
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

In reply to this post by Hemambara
Hello Denis/Ivan, can you please check this and if there are no issues can
you merge the code. Sorry for the rush. We are getting ready for prod in
next 3 months and this is really important for us and we need to test all
our functionality as well. It would be a great help if we have this fixed



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

In reply to this post by Ivan Pavlukhin
I created a gist with my code [1] as it renders not so good inline.

[1] https://gist.github.com/pavlukhin/362c0e40d4a010a8f7c0795368e53efb

чт, 17 окт. 2019 г. в 15:01, Ivan Pavlukhin <[hidden email]>:

>
> Hi Hemambara,
>
> Could you bring a little bit more details about your problem?
> I would like to see you java classes and QueryEntity configuration.
> Ideally it would be to have a runnable reproducer (junit test or class
> with main method).
>
> Also I would like to realize how soon are you expecting a fix in Ignite release?
> As far as I know next Ignite release is planned in the beginning of next year.
>
> I tried following and it worked for me:
>
> class User {
>     String userName;
>     Address address;
>
>     public User(String userName, Address address) {
>         this.userName = userName;
>         this.address = address;
>     }
> }
>
> class Address {
>     String streetName;
>     String zipcode;
>
>     public Address(String streetName, String zipcode) {
>         this.streetName = streetName;
>         this.zipcode = zipcode;
>     }
> }
>
> @Test
> public void testSqlPojoWithoutAnnotations() throws Exception {
>     IgniteEx grid = startGrid(0);
>
>     LinkedHashMap<String, String> fields = new LinkedHashMap<>();
>     fields.put("userName", "String");
>     fields.put("address.zipcode", "String");
>
>     IgniteCache<Object, Object> cache = grid.createCache(new
> CacheConfiguration<>(DEFAULT_CACHE_NAME)
>         .setQueryEntities(Collections.singleton(new
> QueryEntity(Integer.class, User.class)
>             .setFields(fields))));
>
>     cache.put(1, new User("ivan", new Address("a", "123")));
>
>     System.err.println(cache.query(new SqlFieldsQuery("select * from
> User")).getAll());
>
>     System.err.println(cache.query(new SqlFieldsQuery("select zipcode
> from User")).getAll());
>
>     cache.query(new SqlFieldsQuery("create index on User(zipcode)"));
>
>     System.err.println(cache.query(new SqlFieldsQuery("select zipcode
> from User")).getAll());
> }
>
> ср, 16 окт. 2019 г. в 10:59, Hemambara <[hidden email]>:
> >
> > Hello Ivan, can you please check and provide updates on this
> >
> >
> >
> > --
> > Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
>
>
> --
> Best regards,
> Ivan Pavlukhin



--
Best regards,
Ivan Pavlukhin
dmagda dmagda
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

In reply to this post by Hemambara
Please check Ivan's latest response

-
Denis


On Thu, Oct 17, 2019 at 5:16 AM Hemambara <[hidden email]> wrote:
Hello Denis/Ivan, can you please check this and if there are no issues can
you merge the code. Sorry for the rush. We are getting ready for prod in
next 3 months and this is really important for us and we need to test all
our functionality as well. It would be a great help if we have this fixed



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

In reply to this post by Ivan Pavlukhin
ignite_bug_share.zip
<http://apache-ignite-users.70518.x6.nabble.com/file/t2625/ignite_bug_share.zip>  

Thanks for the reply. Please find the attached.

1) IndextestIgniteServer1 - starts server
2) IndexTestIgniteClient1 - starts the client
3) I did not add QueryEntities - we have usecase where we should be able to
add fields and indexes on the fly and ignite does support it.

This program works when we run for the first time. But if we restart client,
it is not able to join the server again because when we use "Users.userName"
field added dynamically, alias is being added as username and when we
restart due to mismatch in configuration it is not able to join

- With this fix, both field and index name will be "Users.userName" and
there wont be any mismatch. I built in local and it looks good.

January we are going with first prod release, if we can have interim patch
for this, that should be fine. Please let us know if that works.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Can you please provide an update



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

I created an example [1] and checked with the proposed fix and without
it. It seems the thing does not work in both cases.

And think that supporting such dynamic nested fields properly is not
an easy thing in general. My first thought is that you need to
implement object relational mapping in your application code.

[1] https://gist.github.com/pavlukhin/3ac27c2def1731a5158222a0d542dfa6

вт, 22 окт. 2019 г. в 01:16, Hemambara <[hidden email]>:
>
> Can you please provide an update
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

I see there are couple of issues with the test

1) cache.query(new SqlFieldsQuery("alter table Person add column
\"Address.street\"  as street varchar"));
   - "as" is not supported in sql. So we should remove "as street" and it
should be like
cache.query(new SqlFieldsQuery("alter table Person add column
\"Address.street\"  varchar"));

2) After making above change, it will work with / with out fix. But the
problem is with out the fix, if you have any other node joining this node,
it will not be able to join / query

I just tweaked your test code. PLease find the below one. main() is your
test class which will start one node.
      a) Take this example and execute main() - this will start one node
     b) now execute @Test method, this will start another node. You will get
attached exception ( exception.txt
<http://apache-ignite-users.70518.x6.nabble.com/file/t2625/exception.txt>  )
with out fix as by default it take alias as "street". But with fix it will
pass through, as it will create alias as "Address.street"

Please let me know if you need more clarification. Any quick help would be
appreciated. Thank you!


package my.ignite.cache.poc.index;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import
org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.junit.Test;

import java.util.Collections;

public class NestedIndexFieldTest {

    public static void main(String args[]){
        TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
                .setIpFinder(new
TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));

        IgniteConfiguration igniteConfig = new
IgniteConfiguration().setDiscoverySpi(discoverySpi);
        Ignite ignite = Ignition.start(igniteConfig);
        try{
            IgniteCache<Object, Object> cache = ignite.createCache(new
CacheConfiguration<>("cache")
            .setIndexedTypes(Integer.class, Person.class));

            cache.put(1, new Person("john", new Address("baker", 221)));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());

            cache.query(new SqlFieldsQuery("alter table Person add column
name varchar"));

            cache.query(new SqlFieldsQuery("alter table Person add column
address other"));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());

            cache.query(new SqlFieldsQuery("alter table Person add column
\"Address.street\"  varchar"));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());

            cache.put(2, new Person("bill", new Address("green", 223)));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());
        } catch (Exception anyEx){

        }

    }

    @Test
    public void test(){
        TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
                .setIpFinder(new
TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));

        IgniteConfiguration igniteConfig = new
IgniteConfiguration().setDiscoverySpi(discoverySpi);

        try(Ignite ignite = Ignition.start(igniteConfig)){
            IgniteCache<Object, Object> cache = ignite.getOrCreateCache(new
CacheConfiguration<>("cache")
                    .setIndexedTypes(Integer.class, Person.class));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());

        }

    }
}

class Person {
    String name;
    Address address;

    Person(String name, Address address){
        this.name = name;
        this.address = address;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", address=" + address +
                '}';
    }
}

class Address {
    String street;
    int number;

    public Address(String street, int number){
        this.street = street;
        this.number = number;
    }

    @Override
    public String toString() {
        return "Address{" +
                "street='" + street + '\'' +
                ", number=" + number +
                '}';
    }
}




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

Yep, I left some trash in gist [1] initially ("as address"), cleaned up.

But does it really works as you need? In previous email I meant that
the behavior is not plausible even in one node case. And the problem
here is that added column "Address.street" is not mapped to
Person.address.street Java object field! It will be a separate column
instead. If separate column is what you need then I do not understand
why you need the name "Address.street", any other same seems to do the
trick.

Did I miss something?

ср, 23 окт. 2019 г. в 00:31, Hemambara <[hidden email]>:

>
> I see there are couple of issues with the test
>
> 1) cache.query(new SqlFieldsQuery("alter table Person add column
> \"Address.street\"  as street varchar"));
>    - "as" is not supported in sql. So we should remove "as street" and it
> should be like
> cache.query(new SqlFieldsQuery("alter table Person add column
> \"Address.street\"  varchar"));
>
> 2) After making above change, it will work with / with out fix. But the
> problem is with out the fix, if you have any other node joining this node,
> it will not be able to join / query
>
> I just tweaked your test code. PLease find the below one. main() is your
> test class which will start one node.
>       a) Take this example and execute main() - this will start one node
>      b) now execute @Test method, this will start another node. You will get
> attached exception ( exception.txt
> <http://apache-ignite-users.70518.x6.nabble.com/file/t2625/exception.txt>  )
> with out fix as by default it take alias as "street". But with fix it will
> pass through, as it will create alias as "Address.street"
>
> Please let me know if you need more clarification. Any quick help would be
> appreciated. Thank you!
>
>
> package my.ignite.cache.poc.index;
>
> import org.apache.ignite.Ignite;
> import org.apache.ignite.IgniteCache;
> import org.apache.ignite.Ignition;
> import org.apache.ignite.cache.query.SqlFieldsQuery;
> import org.apache.ignite.configuration.CacheConfiguration;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
> import
> org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
> import org.junit.Test;
>
> import java.util.Collections;
>
> public class NestedIndexFieldTest {
>
>     public static void main(String args[]){
>         TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
>                 .setIpFinder(new
> TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));
>
>         IgniteConfiguration igniteConfig = new
> IgniteConfiguration().setDiscoverySpi(discoverySpi);
>         Ignite ignite = Ignition.start(igniteConfig);
>         try{
>             IgniteCache<Object, Object> cache = ignite.createCache(new
> CacheConfiguration<>("cache")
>             .setIndexedTypes(Integer.class, Person.class));
>
>             cache.put(1, new Person("john", new Address("baker", 221)));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>
>             cache.query(new SqlFieldsQuery("alter table Person add column
> name varchar"));
>
>             cache.query(new SqlFieldsQuery("alter table Person add column
> address other"));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>
>             cache.query(new SqlFieldsQuery("alter table Person add column
> \"Address.street\"  varchar"));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>
>             cache.put(2, new Person("bill", new Address("green", 223)));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>         } catch (Exception anyEx){
>
>         }
>
>     }
>
>     @Test
>     public void test(){
>         TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
>                 .setIpFinder(new
> TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));
>
>         IgniteConfiguration igniteConfig = new
> IgniteConfiguration().setDiscoverySpi(discoverySpi);
>
>         try(Ignite ignite = Ignition.start(igniteConfig)){
>             IgniteCache<Object, Object> cache = ignite.getOrCreateCache(new
> CacheConfiguration<>("cache")
>                     .setIndexedTypes(Integer.class, Person.class));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>
>         }
>
>     }
> }
>
> class Person {
>     String name;
>     Address address;
>
>     Person(String name, Address address){
>         this.name = name;
>         this.address = address;
>     }
>
>     @Override
>     public String toString() {
>         return "Person{" +
>                 "name='" + name + '\'' +
>                 ", address=" + address +
>                 '}';
>     }
> }
>
> class Address {
>     String street;
>     int number;
>
>     public Address(String street, int number){
>         this.street = street;
>         this.number = number;
>     }
>
>     @Override
>     public String toString() {
>         return "Address{" +
>                 "street='" + street + '\'' +
>                 ", number=" + number +
>                 '}';
>     }
> }
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

HI Ivan, thanks for the quick reply.

Yes it perfectly works as needed with the fix.

Person.Address.Street will not work because
person.getPerson().getAddress().getStreet() does not exist. It has to be
person.getAddress().getStreet(). So column name should be "Address.street"

Any other name does the trick as long as there is alias option provided in
SQL, but in SQLFieldQuery I cannot provide alias option so the only option
that we are left with is use field name as alias name by default. That way
we will be able to rejoin the node.

Also just creating field name as "street" will not work as with the same
name there could be another column

Ex: Person.Address.Street  and Person.College.Address.Street. If we use
street here then which street we we are referring to ? This fix will take
the whole name and use it query to avoid complete ambiguity


Please follow the instructions that I have mentioned in my previous email.
If you execute those two programs with and with out fix, you can get better
idea.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

I rewrote my example in form of a junit test [1]. And I suppose that
it should pass to make the feature useful. Could please check it and
tell me if my understanding is wrong. I tried this test with proposed
fix and without it. Result was the same.

[1] https://gist.githubusercontent.com/pavlukhin/3ac27c2def1731a5158222a0d542dfa6/raw/0fd0b0ee7d51649c8b79d36358ce5a80940254b8/NestedFieldUnitTest.java

ср, 23 окт. 2019 г. в 23:36, Hemambara <[hidden email]>:

>
> HI Ivan, thanks for the quick reply.
>
> Yes it perfectly works as needed with the fix.
>
> Person.Address.Street will not work because
> person.getPerson().getAddress().getStreet() does not exist. It has to be
> person.getAddress().getStreet(). So column name should be "Address.street"
>
> Any other name does the trick as long as there is alias option provided in
> SQL, but in SQLFieldQuery I cannot provide alias option so the only option
> that we are left with is use field name as alias name by default. That way
> we will be able to rejoin the node.
>
> Also just creating field name as "street" will not work as with the same
> name there could be another column
>
> Ex: Person.Address.Street  and Person.College.Address.Street. If we use
> street here then which street we we are referring to ? This fix will take
> the whole name and use it query to avoid complete ambiguity
>
>
> Please follow the instructions that I have mentioned in my previous email.
> If you execute those two programs with and with out fix, you can get better
> idea.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

This post was updated on .
Result should not be same, could you please share your logs. Couple of issues
here.

1) With out fix- I got null instead of "Address.street" value
[[1, Person{name='john', address=Address{street='baker', number=221}}, john,
Address{street='baker', number=221}, null]]

   With fix
   [[1, Person{name='john', address=Address{street='baker', number=221}},
john, Address{street='baker', number=221}, baker]]

2) Also you are trying with only one node. Could you please try to bring
another node. Using below code. This one will just start another node and
try to join existing. With out fix - it cannot join and with fix - it will
join


@Test
    public void test(){
        TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
                .setIpFinder(new
TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));

        IgniteConfiguration igniteConfig = new
IgniteConfiguration().setDiscoverySpi(discoverySpi);

        try(Ignite ignite = Ignition.start(igniteConfig)){
            IgniteCache<Object, Object> cache = ignite.getOrCreateCache(new
CacheConfiguration<>("cache")
                    .setIndexedTypes(Integer.class, Person.class));

            System.err.println(cache.query(new SqlFieldsQuery("Select * from
Person")).getAll());

        }

    }



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

I tried adding 2nd node. I saw a following:
1. Without the fix 2nd is able to join cluster but failed to execute "select *".
2. With and without the fix I always got null for "Address.street".

Could you please consolidate all changes in one pull request and
remove links for irrelevant one from the ticket [1]? Please add
end-to-end test ensuring that added column has non-null value to that
PR as well.

[1] https://issues.apache.org/jira/browse/IGNITE-12261

чт, 24 окт. 2019 г. в 21:30, Hemambara <[hidden email]>:

>
> Result should not be same, could you please share your logs. Couple of issues
> here.
>
> 1) *With out fix *- I got null instead of "Address.street" value
> [[1, Person{name='john', address=Address{street='baker', number=221}}, john,
> Address{street='baker', number=221}, *null*]]
>
>    *With fix*
>    [[1, Person{name='john', address=Address{street='baker', number=221}},
> john, Address{street='baker', number=221},* baker*]]
>
> 2) Also you are trying with only one node. Could you please try to *bring
> another node*. Using below code. This one will just start another node and
> try to join existing. *With out fix - it cannot join and with fix - it will
> join*
>
>
> @Test
>     public void test(){
>         TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi()
>                 .setIpFinder(new
> TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:47500..47509")));
>
>         IgniteConfiguration igniteConfig = new
> IgniteConfiguration().setDiscoverySpi(discoverySpi);
>
>         try(Ignite ignite = Ignition.start(igniteConfig)){
>             IgniteCache<Object, Object> cache = ignite.getOrCreateCache(new
> CacheConfiguration<>("cache")
>                     .setIndexedTypes(Integer.class, Person.class));
>
>             System.err.println(cache.query(new SqlFieldsQuery("Select * from
> Person")).getAll());
>
>         }
>
>     }
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Ohh yes you are right. Without the fix, it is failing to query cache. With
the other approach that I have attached earlier it failed to join node,
there I have CacheConfiguration in xml file for both server and client node.
Not sure if that does matters. Either way it is failing

Also this is my bad, my apologies, that I forget to check in one change in
GridQueryProcessor.java where it is using QueryBinaryProperty constructor,
instead I am using QUeryUtils.buildBinaryProperty to build it. Now I have
checked in all the changes along with test cases.

Can you please review pull requests:
https://github.com/apache/ignite/pull/7008 - Change in QueryUtils
https://github.com/apache/ignite/pull/7009 - Test case for QueryUtilsTest
https://github.com/apache/ignite/pull/7010 - Change in
GridQueryProcessor.java
https://github.com/apache/ignite/pull/7011 - Test case to make sure it is
adding nested field

I could not merge pull request as it is saying that only users with "Write
access" can merge pull requests. Can you please merge these pull requests
and review. Please let me know if you see any issues.

Appreciate your help on this.





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

It really good that we have common understanding now.
> I could not merge pull request as it is saying that only users with "Write access" can merge pull requests

By merge I meant merging branches in your fork repository. It is
really inconvenient to work with bunch of PRs simultaneously. It will
be great if there is only one PR.

пт, 25 окт. 2019 г. в 14:43, Hemambara <[hidden email]>:

>
> Ohh yes you are right. Without the fix, it is failing to query cache. With
> the other approach that I have attached earlier it failed to join node,
> there I have CacheConfiguration in xml file for both server and client node.
> Not sure if that does matters. Either way it is failing
>
> Also this is my bad, my apologies, that I forget to check in one change in
> GridQueryProcessor.java where it is using QueryBinaryProperty constructor,
> instead I am using QUeryUtils.buildBinaryProperty to build it. Now I have
> checked in all the changes along with test cases.
>
> Can you please review pull requests:
> https://github.com/apache/ignite/pull/7008 - Change in QueryUtils
> https://github.com/apache/ignite/pull/7009 - Test case for QueryUtilsTest
> https://github.com/apache/ignite/pull/7010 - Change in
> GridQueryProcessor.java
> https://github.com/apache/ignite/pull/7011 - Test case to make sure it is
> adding nested field
>
> I could not merge pull request as it is saying that only users with "Write
> access" can merge pull requests. Can you please merge these pull requests
> and review. Please let me know if you see any issues.
>
> Appreciate your help on this.
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Sure. Have created one https://github.com/apache/ignite/pull/7016

Can you please check this. It has all the changes at one place. please let
me know for any issues. Thank you.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hello Ivan, please let me know if you get a chance to check the code and
merge it..



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Ivan Pavlukhin Ivan Pavlukhin
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

Hi Hemambara,

I checked some more scenarios with your fix. I a scenario:
1. Register QueryEntity with classes
class Person { String name; Address address; }
class Address { String street; }
2. cache.put(1, new Person(...))
3. Add column dynamically
alter table add column "Address.number"
4. UPDATE Person set "Address.number" = 666
5. Update class Address to be
class Address { String street; int number; }
6. Retrieving a value from cache
cache.get(1).address.number
results in a weird exception.

I checked the same scenario with flat objects (without nesting) and it
finished successfully.

I am afraid I cannot merge the proposed fix as is. The thing with
nesting SQL fields is quite complicated and requires thorough
analysis. Unfortunately, I do not have enough time frame to do a
sufficient analysis.

ср, 30 окт. 2019 г. в 13:31, Hemambara <[hidden email]>:
>
> Hello Ivan, please let me know if you get a chance to check the code and
> merge it..
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



--
Best regards,
Ivan Pavlukhin
Hemambara Hemambara
Reply | Threaded
Open this post in threaded view
|

Re: Issue with adding nested index dynamically

I did not face any issue. Its working fine for me. Can you share your code
and exception that you are getting

I tried like below and it worked for me.
((Person)cache.get(1)).address.community)





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
123