You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by mvneethu <ne...@tigeranalytics.com> on 2018/07/03 06:03:38 UTC

How to configure the default data type measure decimal(19, 4)?

Currently, I am not able to select the data type of the measure. I want to
have decimal(19,6) but in my current version 2.2.0, kylin defaults the data
type to decimal(19,4). How can I change this? Please respond.

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by mvneethu <ne...@tigeranalytics.com>.
One doubt, when I am creating the cube, I see the default type of the measure
is decimal(19,4). Will it change after I build the cube?

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by ShaoFeng Shi <sh...@apache.org>.
Hi, forget to mention, please delete the "signature" property in JSON when
you do a manual modification. Kylin doesn't expect the user to manually
modify metadata, so adding this check. My method is a hack way
(not practice), you need to take the risk on your own. Always taking a
backup before doing change so that you can recover if something went wrong.

If you think this is a requirement, please open a JIRA, and a patch is also
welcomed if you can solve that.

2018-07-03 23:29 GMT+08:00 mvneethu <ne...@tigeranalytics.com>:

> So I have restored and restarted kylin and I can see that the data type has
> been changed to decimal(19,6). When I try to build the cube it says, it
> gives me an error saying that "inconsistent cubedesc_signature". Is there
> anything I should do for that?
>
> --
> Sent from: http://apache-kylin.74782.x6.nabble.com/
>



-- 
Best regards,

Shaofeng Shi 史少锋

Re: How to configure the default data type measure decimal(19, 4)?

Posted by mvneethu <ne...@tigeranalytics.com>.
So I have restored and restarted kylin and I can see that the data type has
been changed to decimal(19,6). When I try to build the cube it says, it
gives me an error saying that "inconsistent cubedesc_signature". Is there
anything I should do for that?

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by mvneethu <ne...@tigeranalytics.com>.
Hi,
So I have changed the json file of my cube after taking the backup and now
do I have to restore to see the change?

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by ShaoFeng Shi <sh...@apache.org>.
Hi Neethu,

I just realized these configurations are used when there is no defined
scale and precision, such as "decimal"; If the scale and precision is
presented, the parameter has no effect.

So far there is no way for the user to modify the return type on GUI, but
you can workaround by modifying the metadata with the metadata backup and
restore. (https://kylin.apache.org/docs/howto/howto_backup_metadata.html)

After taking a backup, you can find the cube description in /cube_desc
folder, find your cube, and then edit it. Find the measure you want to
modify, change it; for example:

"measures" : [ {
    "name" : "GMV_SUM",
    "function" : {
      "expression" : "SUM",
      "parameter" : {
        "type" : "column",
        "value" : "KYLIN_SALES.PRICE",
        "next_parameter" : null
      },
      "returntype" : "decimal(19,4)"
    }
  },


2018-07-03 19:14 GMT+08:00 mvneethu <ne...@tigeranalytics.com>:

> Yes, I have sync the hive table again and seems to take the default
> decimal(19,4).
>
> --
> Sent from: http://apache-kylin.74782.x6.nabble.com/
>



-- 
Best regards,

Shaofeng Shi 史少锋

Re: How to configure the default data type measure decimal(19, 4)?

Posted by mvneethu <ne...@tigeranalytics.com>.
Yes, I have sync the hive table again and seems to take the default
decimal(19,4).

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by ShaoFeng Shi <sh...@apache.org>.
Hi, did you re-sync the table from Hive to Kylin? If not, please re-sync it.

2018-07-03 17:23 GMT+08:00 mvneethu <ne...@tigeranalytics.com>:

> Hi,
> Thanks for your response. I have configured the kylin.properties file with
> kylin.source.hive.default-decimal-scale=6
> kylin.source.hive.default-decimal-precision=19
> and restarted kylin. But still I get the default as decimal(19,4). Please
> help.
>
> --
> Sent from: http://apache-kylin.74782.x6.nabble.com/
>



-- 
Best regards,

Shaofeng Shi 史少锋

Re: How to configure the default data type measure decimal(19, 4)?

Posted by mvneethu <ne...@tigeranalytics.com>.
Hi,
Thanks for your response. I have configured the kylin.properties file with 
kylin.source.hive.default-decimal-scale=6
kylin.source.hive.default-decimal-precision=19
and restarted kylin. But still I get the default as decimal(19,4). Please
help.

--
Sent from: http://apache-kylin.74782.x6.nabble.com/

Re: How to configure the default data type measure decimal(19, 4)?

Posted by ShaoFeng Shi <sh...@apache.org>.
Hi Neethu,

You can configure the default scale and factor by parameters, search
"kylin.source.hive.default-decimal-scale" and
"kylin.source.hive.default-decimal-precision" in:

https://kylin.apache.org/docs/install/configuration.html

2018-07-03 14:03 GMT+08:00 mvneethu <ne...@tigeranalytics.com>:

> Currently, I am not able to select the data type of the measure. I want to
> have decimal(19,6) but in my current version 2.2.0, kylin defaults the data
> type to decimal(19,4). How can I change this? Please respond.
>
> --
> Sent from: http://apache-kylin.74782.x6.nabble.com/
>



-- 
Best regards,

Shaofeng Shi 史少锋