> we just want to get the name column. Sorry, I overlooked this statement. Then the right solution should be the "Extended column" Shaofeng proposed. Max(string) is an ugly workaround.
"Extended column" is a column whose value is stored in place of measures. It is much slower to filter and group by, but has no performance penalty in your case. Yang On Sun, Jun 26, 2016 at 11:46 PM, yu feng <[email protected]> wrote: > we also has this demand, for derived dimension, lookup table is too big > for memory, so put the name to measure is a good choice, I will work on it > to support max on string. > > 2016-06-26 21:24 GMT+08:00 Li Yang <[email protected]>: > >> The best solution is to let Kylin support max on strings. Please open a >> JIRA to track. >> >> On Thu, Jun 23, 2016 at 11:18 PM, ShaoFeng Shi <[email protected]> >> wrote: >> >>> The new "Extended column" measure will match your case; It is a "Derived" >>> column but on fact table; You can see more with KYLIN-1313. >>> >>> 2016-06-23 17:25 GMT+08:00 Hao Chen <[email protected]>: >>> >>> > Hi, all. >>> > given a dimension table: >>> > >>> > dim_table{ >>> > id_column int, >>> > name_column string >>> > } >>> > >>> > and a fact table: >>> > fact_table{ >>> > id_column int, >>> > measure int >>> > } >>> > >>> > usually we select with this sql: >>> > select >>> > dim.id_column, >>> > max(dim.name_column), >>> > sum(fact.measure) >>> > from fact_table as fact >>> > join dim_table as dim >>> > on fact.id_column = dim.id_column >>> > group by dim.id_column >>> > >>> > >>> > we just want to get the name column. >>> > one way is to add the name_column as a derived dimension. But it costs >>> > memory and slow down query. >>> > another way is make name_column as a measure with max as aggregation >>> > function. But kylin do not support Max on string type column. >>> > >>> > Is there any better way to solve this problem? >>> > thanks! >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > -- >>> > 陈昊/Jerry Chen >>> > >>> > Tel: (+86)15013773175 >>> > Email: jerrychen <[email protected]>[email protected] >>> > P.C. 518055 >>> > Add: 中国广东省深圳市西丽大学城清华园H楼205 >>> > Room 205, Building H, Tsinghua Campus, The University Town, Shenzhen, >>> > P.R.China >>> > 清华大学计算机科学与技术系 >>> > Department of Computer Science and Technology, Tsinghua University >>> > >>> >>> >>> >>> -- >>> Best regards, >>> >>> Shaofeng Shi >>> >> >> >
