Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignite Native query not comparing when Colum value has '-' in value name #11963

Open
kagrawal-tibco opened this issue Mar 25, 2025 · 2 comments

Comments

@kagrawal-tibco
Copy link

While running the ignite queries through code and through Dbeaver (thin client) the results are not as expected .
Example : if running query like
Select * from where = 'itemCon1-15';
Then it returns a empty set despite value is present.

Is '-' not supported in ignite?

@ptupitsyn
Copy link
Contributor

Can't reproduce, could you please share a full reproducer (a project to run)?

Here is what I tried (in C#, but it works the same in Java)

using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Cache.Query;

using var ignite = Apache.Ignite.Core.Ignition.Start();

var cfg = new CacheConfiguration("person", new QueryEntity(typeof(int), typeof(Person)));
var cache = ignite.GetOrCreateCache<int, Person>(cfg);
cache[1] = new Person("foo-bar");

Query("select * from Person where name = ?", "foo-bar");
Query("select * from Person where name = 'foo-bar'");

void Query(string q, params object[] args)
{
    var res = cache.Query(new SqlFieldsQuery(q, args)).GetAll();
    Console.WriteLine($">>>> Query '{q}' returned {res.Count} results: ");

    foreach (var row in res)
    {
        Console.WriteLine(string.Join(", ", row));
    }
}

public record Person([property: QuerySqlField] string Name);

Results:

>>>> Query 'select * from Person where name = ?' returned 1 results: 
foo-bar
>>>> Query 'select * from Person where name = 'foo-bar'' returned 1 results: 
foo-bar

@kagrawal-tibco
Copy link
Author

Thank you Pavel for a quick response I tested with primary key column . I will try to attach the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants