martes, 13 de octubre de 2009

Solucionando error Mondrian y PostgreSQL 8.3.8


Para solucionar el error:

Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: com.tonbeller.jpivot.olap.model.OlapException: ERROR: no existe la función upper(smallint)

de las versiones antiguas de Mondrian y la visualizacion de Cubos OLAP sobre el gestor de base de datos PostgreSQL 8.3.8, tenemos que especifiar en el esquema del cubo el tipo de dato de cada colmna en la etiqueta Level atributo type . Les dejo un fragmento del esquema de un cubo y su definición en XML.



<!-- Producto -->
<Dimension name="Producto">
<Hierarchy name="Tipo" hasAll="true" primaryKey="id_dim" caption="Producto/Tipo" allMemberName="Todas" allMemberCaption="(Todas)">
<Table name="dim_producto"/>
<Level name="Tipo" column="tipo_codigo" nameColumn="tipo_desc" hideMemberIf="IfBlankName" type="String"/>
<Level name="Producto" column="id_producto" nameColumn="nombre_producto" hideMemberIf="IfBlankName" type="Numeric">
<Property name="Precio_mn" column="precios" type="Numeric"/>
<Property name="Precio_usd" column="precio_usd" type="Numeric"/>
<Property name="Unidad_medida" column="unidad_medida" type="String"/>
</Level>
</Hierarchy>
<Hierarchy name="Grupo" hasAll="true" primaryKey="id_dim" caption="Producto/Grupo" allMemberName="Todas" allMemberCaption="(Todas)">
<Table name="dim_producto"/>
<Level name="Grupo" column="grupo_codigo" nameColumn="grupo_desc" hideMemberIf="IfBlankName" type="String"/>
<Level name="Producto" column="id_producto" nameColumn="nombre_producto" hideMemberIf="IfBlankName" type="Numeric">
<Property name="Precio_mn" column="precios" type="Numeric"/>
<Property name="Precio_usd" column="precio_usd" type="Numeric"/>
<Property name="Unidad_medida" column="unidad_medida" type="String"/>
</Level>
</Hierarchy>
</Dimension>



{"String", "Numeric", "Integer", "Boolean", "Date", "Time", "Timestamp"}

por defecto es
String. Seguido les dejo algnas referenias que me ayudaron a reslver el problema.


Referencias:
http://forums.pentaho.org/showthread.php?t=26453&highlight=upper
http://forums.pentaho.org/showthread.php?t=51166
http://docs.huihoo.com/javadoc/mondrian/3.0.4/src-html/mondrian/olap/MondrianDef.Level.html#line.1193

No hay comentarios:

Publicar un comentario