ignite
ignite copied to clipboard
Ignite Native query not comparing when Colum value has '-' in value name
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
Is '-' not supported in ignite?
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
Thank you Pavel for a quick response I tested with primary key column . I will try to attach the project.