manticoresoftware / columnar

Manticore Columnar Library
Apache License 2.0
82 stars 15 forks source link

String comparison is not working #51

Closed sanikolaev closed 7 months ago

sanikolaev commented 7 months ago

In:

mysql> show version;
--------------
show version
--------------

+-----------+--------------------------------+
| Component | Version                        |
+-----------+--------------------------------+
| Daemon    | 6.2.13 dbd94ac5c@24032423 dev  |
| Columnar  | columnar 2.2.5 aa3504b@240304  |
| Secondary | secondary 2.2.5 aa3504b@240304 |
| KNN       | knn 2.2.5 aa3504b@240304       |
| Buddy     | buddy v2.3.1                   |
+-----------+--------------------------------+
5 rows in set (0.01 sec)

select * from t where s < 'b' shows b instead of a:

mysql> drop table if exists t; create table t(s string) engine='columnar'; insert into t values (1,'a'),(2,'b'); select * from t where s < 'b';
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
create table t(s string) engine='columnar'
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
insert into t values (1,'a'),(2,'b')
--------------

Query OK, 2 rows affected (0.00 sec)

--------------
select * from t where s < 'b'
--------------

+------+------+
| id   | s    |
+------+------+
|    2 | b    |
+------+------+
1 row in set (0.00 sec)
--- 1 out of 1 results in 0ms ---

Expected: same as with the row-wise storage:

mysql> drop table if exists t; create table t(s string); insert into t values (1,'a'),(2,'b'); select * from t where s < 'b';
--------------
drop table if exists t
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
create table t(s string)
--------------

Query OK, 0 rows affected (0.01 sec)

--------------
insert into t values (1,'a'),(2,'b')
--------------

Query OK, 2 rows affected (0.00 sec)

--------------
select * from t where s < 'b'
--------------

+------+------+
| id   | s    |
+------+------+
|    1 | a    |
+------+------+
1 row in set (0.00 sec)
--- 1 out of 1 results in 0ms ---
tomatolog commented 7 months ago

fixed at https://github.com/manticoresoftware/manticoresearch/commit/ce4645ed3ba4e279ebfae136849fffb397e80b01 there string filter comparsion for columnar attributes was added