Open jlerebours opened 1 year ago
Just giving some more information, after investigating a bit more : The problem is actually about the aggregation type and not as I said the data type (int, varchar, etc)
And more particularly one thing that I don't get is that we have to keep the same type as original/base column meaning that i have to use :
And this leads to my question : why can't we do some sum(k1) if k1 is MIN ? The main purpose of views and aggregating is often to sum stuff even if model is MIN.
But my main question is : how to handle columns that are of type REPLACE ?
so,cannot deal this problem now?
Search before asking
Version
1.2.1
What's Wrong?
Impossible to create the simplest materialized view having a group by for a table with aggregate model
What You Expected?
To be able to create a view on an Aggregate Key model, nothing in the documentation specifying it should not work. According to me that's the base use case of aggregate model no ?
How to Reproduce?
I just used the simplest example visible in the documentation and added a REPLACE on one column so that my model is of type Aggregate. Here are the steps to reproduce :
The last query returns this error :
ERROR 1105 (HY000): errCode = 2, detailMessage = The aggregation type of column[sale_amt] must be same as the aggregate type of base column in aggregate table
Anything Else?
If you just remove the REPLACE for the column sale_amt, then the model of table becomes Duplicate Key and materialized view can be created without problem.
I also tested without the sum, just with a simple select of a field and same problem :
Sorry if my issue is not very clean, that's my first one !
Are you willing to submit PR?
Code of Conduct