Hi Puneet,

Yes </dim_attributes> tag was redundant but the actual problem was missing 
<measures> tag. I got the cube created after adding measure tag. It is the 
mandatory tag for creating cube I guess.
And if this is the case, I was wondering if we can have a check on such 
mandatory tags while reading tags from xml file for creating cube or other lens 
entities else it would teadious for a newbie to figure out such dependencies.

lens-shell>! grep -A 33333333 <x_ examples/resources/telecom/temp.xml
command is:grep -A 33333333 <x_ examples/resources/telecom/temp.xml
<x_base_cube name="aaa" xmlns="uri:lens:cube:0.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">

  <dim_attributes>
    <dim_attribute name="subscriber_id" _type="int"/>
    <dim_attribute name="record_type" _type="string"/>
    <dim_attribute name="a_number" _type="string"/>
    <dim_attribute name="b_number" _type="string"/>
    <dim_attribute name="duration" _type="int"/>
    <dim_attribute name="time_stamp" _type="timestamp"/>
  </dim_attributes>
</x_base_cube>

lens-shell>create cube examples/resources/telecom/temp.xml
failed

--------------------------------------------------------------------------------------------------------------
Added <measure> tag.

lens-shell>! grep -A 33333333 <x_ examples/resources/telecom/temp.xml
command is:grep -A 33333333 <x_ examples/resources/telecom/temp.xml
<x_base_cube name="aaa" xmlns="uri:lens:cube:0.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <measures>
    <measure name="qqq" _type="BIGINT" default_aggr="SUM" display_string="Total 
Duration" format_string="#,###"/>
  </measures>
  <dim_attributes>
    <dim_attribute name="subscriber_id" _type="int"/>
    <dim_attribute name="record_type" _type="string"/>
    <dim_attribute name="a_number" _type="string"/>
    <dim_attribute name="b_number" _type="string"/>
    <dim_attribute name="duration" _type="int"/>
    <dim_attribute name="time_stamp" _type="timestamp"/>
  </dim_attributes>
</x_base_cube>

lens-shell>create cube examples/resources/telecom/temp.xml
succeeded

Thanks
Pawan Malwal

From: Puneet Gupta [mailto:puneet.gu...@inmobi.com]
Sent: 19 September 2016 16:42
To: user@lens.apache.org
Cc: Sharanabasappa G Keriwaddi <sha...@huawei.com>
Subject: Re: Cube creation failed.

Hi Pawan

Looks like the error is on client side . Lens client is not able to parse the 
XML file ( the line before   </dim_attributes>  looks redundant )
You can enable logs on lens-cli by just typing "debug" on the shell to get more 
details of client side errors.

Also you can refer to "lens-api/src/main/resources/cube-0.1.xsd" for schema 
definition.

Regards,
Puneet Gupta

On Sat, Sep 17, 2016 at 5:58 PM, Pawan Malwal 
<pawan.mal...@huawei.com<mailto:pawan.mal...@huawei.com>> wrote:
Hi Lens Developers,

I am trying to create a cube through Lens CLI. For some reason it is failing 
and I do not see any log message logged in the  lensserver.log. Any clue what 
could be the reason and where can I get the logs for the same.?

Do we have any document or link on creating cubes. I see some examples but I am 
finding it difficult to create it. I see there are many things we can have in a 
cube xml file but not sure if there are some mandatory tags or something?

lens-shell>! grep -A 33333333 <x_ examples/resources/telecom/cdr-cube.xml
command is:grep -A 33333333 <x_ examples/resources/telecom/cdr-cube.xml
<x_base_cube name="cdr_cube" xmlns="uri:lens:cube:0.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="uri:lens:cube:0.1 cube-0.1.xsd ">
  <measures>
    <measure name="SUM_DURATION" _type="INT" default_aggr="SUM"/>
  </measures>
  <dim_attributes>
    <dim_attribute name="SUBSCRIBER_ID" _type="INT"/>
    <dim_attribute name="RECORD_TYPE" _type="STRING"/>
    <dim_attribute name="A_NUMBER" _type="STRING"/>
    <dim_attribute name="B_NUMBER" _type="STRING"/>
   <dim_attribute name="DURATION" _type="INT"/>
    <dim_attribute name="TIME_STAMP" _type="TIMESTAMP"/>
    </dim_attribute>
  </dim_attributes>
  <expressions>
    <expression name="DURATION_MIN" _type="FLOAT" 
display_string="Duration(Min.)">
      <expr_spec expr = "DURATION / 60" />
    </expression>
  </expressions>
</x_base_cube>


lens-shell>create cube examples/resources/telecom/cdr-cube.xml
failed

Regards
Pawan Malwal


_____________________________________________________________
The information contained in this communication is intended solely for the use 
of the individual or entity to whom it is addressed and others authorized to 
receive it. It may contain confidential or legally privileged information. If 
you are not the intended recipient you are hereby notified that any disclosure, 
copying, distribution or taking any action in reliance on the contents of this 
information is strictly prohibited and may be unlawful. If you have received 
this communication in error, please notify us immediately by responding to this 
email and then delete it from your system. The firm is neither liable for the 
proper and complete transmission of the information contained in this 
communication nor for any delay in its receipt.

Reply via email to