ignite icon indicating copy to clipboard operation
ignite copied to clipboard

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

Open kagrawal-tibco opened this issue 9 months ago • 2 comments

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?

kagrawal-tibco avatar Mar 25 '25 05:03 kagrawal-tibco

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

ptupitsyn avatar Mar 26 '25 05:03 ptupitsyn

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

kagrawal-tibco avatar Mar 26 '25 06:03 kagrawal-tibco