[MCOL-474] geometry functions can only be used in the outermost select or order by clause and cannot be used in conjunction with an aggregate function. Created: 2016-12-19  Updated: 2022-11-05  Resolved: 2022-11-05

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.0.6
Fix Version/s: Icebox

Type: New Feature Priority: Minor
Reporter: Roy Bellingan Assignee: Todd Stoffel (Inactive)
Resolution: Won't Do Votes: 0
Labels: None

Epic Link: ColumnStore Compatibility Improvements

 Description   

I tried to search about this error message but the only result is the InfiniDb error string list.

What I think is that those function are not marked as thread safe / reentrant / deterministic, so can not be used in certain processing stage of InfiniDB.

In my case I was trying to join a table using the ST_contains(p.polygon, POINT ()) trick, because I have to join a table using a range...

The query is like the following

select count as trx, sum(cost)
from transactions as t
join ip2city as c on ST_contains(p.polygon, POINT(CONV(hex(ip_bin), 16, 10), 0 ))
group by c.cityName

I tried a lot of method to join those two table, but this is the only one working...

Please if you can point me where to start to look up on this thesis, that we just need to remove / add this function to the list of "good" one.



 Comments   
Comment by David Thompson (Inactive) [ 2016-12-20 ]

Please note this jira project is for MariaDB ColumnStore not Infinidb. I will take a look but if there is a code issue it will only be fixed in the ColumnStore code base.

Comment by Roy Bellingan [ 2016-12-20 ]

I did a small test to see if also the ST_contains operator was "not liked" and yes

Function 'st_contains' can only be used in the outermost select or order by clause and cannot be used in conjunction with an aggregate function.

The query is

select c.id
from point_test as c
join ip2city as p on ST_contains(p.polygon, c.p)
join transactions as t ON t.id = c.id
where c.id < 1000

In addition even if I create even a simple function like

CREATE FUNCTION fuz (s int(10))
RETURNS int(10)  DETERMINISTIC
RETURN 1;

select t.id
from t2 as c
join transactions as t ON t.id = fuz4(c.id)

The query will fail...

The error ERR_NON_SUPPORTED_FUNCTION looks like is called ONLY in dbcon/mysql/ha_calpont_execplan.cpp in 6 part (I am using https://github.com/mariadb-corporation/mariadb-columnstore-server master branch)

But . I really have no idea what to do next...

Comment by David Thompson (Inactive) [ 2016-12-21 ]

Yes, the issue is that for both infinidb and columnstore, that we need a distinct function implementation to be implemented for the PM data processing. Not all standard functions have been implemented and the same is true for user definied functions. These can be used in the select list and order by clauses since these are actually executed by the mariadb (or mysql in infinidb) server.

I will take this jira as an enhancement request to support distributed geometry functions. It would be better to track user defined functions as a seperate improvement. If you have the ability to modify and test this out we'd of course love to have some additional resources to help out on this.

Comment by David Thompson (Inactive) [ 2016-12-21 ]

To clarify, aggregates are processed by the PM servers using the batch primitive step definitions. The PM servers are completely unaware of SQL or mariadb server and so this is why we need to have a specific and optimized implementation that understands the lower level block and columnar structure.

Comment by Todd Stoffel (Inactive) [ 2022-11-05 ]

This item is being closed because it was well passed the expiration date with no activity. If you suspect this was done in error please create a new ticket.

Generated at Thu Feb 08 02:21:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.