ããã§ã芪æãªãKhabrovitesãç§ãã¡ã®äŒç€Ÿã§OLAPãµãŒããŒãã©ã®ããã«äžããå¿ èŠããããã«ã€ããŠã®æ瀺ãæäŸããããšæããŸãã æé ãè¿œã£ãŠãPentahoã®ã€ã³ã¹ããŒã«ãšæ§æããå§ãŸããããŒã¿ããŒãã«ã®æºåãšãµãŒããŒäžã§ã®olapãã¥ãŒãã®å ¬éãŸã§ããã©ã£ããã¹ã«æ²¿ã£ãŠé²ã¿ãŸãã åœç¶ãããã®å€ãã¯æ··ä¹±/äžæ£ç¢º/æé©ã§ã¯ãªãå¯èœæ§ããããŸããããµãŒããŒãäžããŠãPentahoãèªå·±èšè¿°çµ±èšã眮ãæããããšãã§ãããã©ããã確èªããå¿ èŠãããå Žåãããã¯ãããŸããã§ãã...
OLAPãµãŒããŒãæ§ç¯ããããã»ã¹å šäœã3ã€ã®éšåã«åããŸããã
- Pentaho BIãµãŒããŒã®ã»ããã¢ãã
- ãã¡ã¯ãããŒãã«ãšæž¬å®å€ã®æºå
- ãã¥ãŒããäœæãããµãŒããŒã«å ¬éãã
Pentaho BIãµãŒããŒã®ã»ããã¢ãã
JDKãã€ã³ã¹ããŒã«ããŸãã
ç°å¢å€æ°ãèšå®ããŸãã
JAVA_HOME=c:\Program Files\Java\jdk1.7.0_15 JRE_HOME=c:\Program Files\Java\jdk1.7.0_15\jre PENTAHO_JAVA_HOME=c:\Program Files\Java\jdk1.7.0_15
Pentaho Business Intelligenceã®ææ°ããŒãžã§ã³ïŒ biserver-ce-4.8.0-stable.zip ïŒãããŠã³ããŒãããŠè§£åããŸãã ã¢ãŒã«ã€ãã®å å®¹ïŒ administration-consoleããã³biserver-ceãã©ã«ããŒïŒãcïŒ\ Pentahoãã©ã«ããŒã«ã¢ããããŒãããŸããã ãããã£ãŠãã¢ã³ããã¯-ã¢ã³ããã¯ãããŸãããããµãŒããŒã¯ãŸã æ§æãããŠããŸããã ãããç§ãã¡ãä»ããããšã§ã...
Javaçšã®MySQLã³ãã¯ã¿ïŒ mysql-connector-java-5.1.23-bin.jar ïŒãããŠã³ããŒãããŸãã cïŒ\ Pentaho \ biserver-ce \ tomcat \ libãã©ã«ãã«ããããããŸãã
ããã©ã«ãã§ã¯ãPentahoã¯HSQLDBãšã³ãžã³ã䜿çšããŸãã sampledataãã¹ãããŒã¿ããŒã¹ãå«ããã¹ãŠã®ããŒã¿ããŒã¹ãã¡ã¢ãªã«äœæããŠä¿åããŸãã ããã¯å°ããªããŒãã«ïŒãã¢ãªã©ïŒã®å Žåã§ãæ£åžžã§ãããæŠéããŒã¿ã®å Žåããšã³ãžã³ã¯éåžžãããšãã°MySQLãŸãã¯Oracleã«å€æŽãããŸãã MySQLã䜿çšããŸãã
MySQLã®äŒæ¢ç¶æ ããŒã¿ããŒã¹ãšã¯ã©ãŒãããŒã¿ããŒã¹ã«å ¥åããŸãã äž¡æ¹ãšããPentahoã·ã¹ãã ã®ããŒãºã«äœ¿çšãããŸãã ãããããã¡ã€ã«1_create_repository_mysql.sqlããã³2_create_quartz_mysql.sqlãããŠã³ããŒãããŸãã ããããMySQLã«ã€ã³ããŒãããŸãã
ããã§ãMySQLãµãŒããŒãPentahoãªããžããªãšããŠèšå®ãããŸããã ããã©ã«ãã§ãã®ãªããžããªã䜿çšããããã«PentahoãµãŒããŒãæ§æããŸãã ãããè¡ãã«ã¯ã次ã®xml-kiãç·šéããŸãã
1. \ pentaho-solutions \ system \ applicationContext-spring-security-hibernate.properties
ãã©ã€ããŒãURLãããã³æ¹èšãããããcom.mysql.jdbc.Driver ã jdbcïŒmysqlïŒ// localhostïŒ3306 / hibernateããã³org.hibernate.dialect.MySQL5Dialectã«å€æŽããŸãã
2. \ tomcat \ webapps \ pentaho \ META-INF \ context.xml
driverClassNameãã©ã¡ãŒã¿ãŒãcom.mysql.jdbc.Driverã«å€æŽããurlãã©ã¡ãŒã¿ãŒãjdbcïŒmysqlïŒ// localhostïŒ3306 / hibernateããã³jdbcïŒmysqlïŒ// localhostïŒ3306 / quartzã«ãããã2ã€ã®ã»ã¯ã·ã§ã³ã§ãvalidationQueryãã©ã¡ãŒã¿ãŒãå€æŽããŠéžæããŸã1
3. \ pentaho-solutions \ system \ hibernate \ hibernate-settings.xml
<config-file>ãã©ã¡ãŒã¿ãŒã§ãhsql.hibernate.cfg.xmlãmysql5.hibernate.cfg.xmlã«å€æŽããŸã ã
4. \ pentaho-solutions \ system \ simple-jndi \ jdbc.properties
HibernateãšQuartz以å€ã®äžèŠãªãŽãã¯ãã¹ãŠåé€ããŸãã
5.ãã©ã«ããŒ\ pentaho-solutions \ bi-developers ã \ pentaho-solutions \ plugin-samples ãããã³\ pentaho-solutions \ steel-wheelsãç Žæ£ããŸãã ããã¯ãã¹ãããŒã¿ã§ãããåºæ¬çã«ã¯å¿ èŠãããŸããã
6. \ tomcat \ webapps \ pentaho \ WEB-INF \ web.xml
ThemeServletãé€ã[BEGIN SAMPLE SERVLETS]ããã³[BEGIN SAMPLE SERVLET MAPPINGS]ã»ã¯ã·ã§ã³ã®ãã¹ãŠã®ãµãŒãã¬ãããåé€ãŸãã¯ã³ã¡ã³ãããŸãã
[BEGIN HSQLDB STARTER]ããã³[BEGIN HSQLDB DATABASES]ã»ã¯ã·ã§ã³ãåé€ããŸãã
è¡ãåé€ããŸãã
<filter-mapping> <filter-name>SystemStatusFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
7. \ dataãã£ã¬ã¯ããªãåé€ããŸã ã ãã®ãã£ã¬ã¯ããªã«ã¯ããã¹ãããŒã¿ããŒã¹ããã®ããŒã¿ããŒã¹ãå®è¡ããPentahoãªããžããªãåæåããã¹ã¯ãªãããå«ãŸããŠããŸãã
8. \ pentaho-solutions \ system \ olap \ datasources.xml
SteelWheelsããã³SampleDataãšããååã®ãã£ã¬ã¯ããªãåé€ããŸãã
9. \ pentaho-solutions \ system \ systemListeners.xml
è¡ãåé€ãŸãã¯ã³ã¡ã³ãã¢ãŠãããŸãã
<bean id="pooledDataSourceSystemListener" class="org.pentaho.platform.engine.services.connection.datasource.dbcp.PooledDatasourceSystemListener" />
10. \ tomcat \ webapps \ pentaho \ WEB-INF \ web.xml
ãœãªã¥ãŒã·ã§ã³ãã¹ã瀺ããŸãïŒ cïŒ\ Pentaho \ biserver-ce \ pentaho-solutions ã
11. \ system \ sessionStartupActions.xml
ãã¹ãŠã®ãããã¯ã
...
ãŸãã¯åé€ããŸã
...
Pentaho Webãã§ã€ã¹ã®æ§æ
æ§æã䜿çšãããã¹ãŠã®æäœã®åŸãæ¢ã«äœããå®è¡ã§ããŸãã ãµãŒããŒã®ãããã©ã«ããŒã«ç§»åãã start-pentaho.batãŸãã¯sh-shnikãå®è¡ããŸãããããã®ãŠãŒã¶ãŒã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã§äœãå¿ èŠãªã®ã§ããããã çè«çã«ã¯ãã³ã³ãœãŒã«ãŸãã¯Tomcatãã°ã«ãšã©ãŒã¯ãããªãã¯ãã§ãã
ã ããããã¹ãŠãé 調ã«é²ãã ãã
localhost:8080
localhost:8080
ãã°ã€ã³ãã©ãŒã ã衚瀺ãããŸãïŒ
æšæºã®ãŠãŒã¶ãŒå/ãã¹ã¯ãŒãïŒ joe / password ïŒãå ¥åããŠãå éšã«å ¥ããŸãã 次ã«ãolap-clientãã€ã³ã¹ããŒã«ããå¿ èŠããããŸããå®éã«ã¯ãèŠæ±ã衚瀺ãããŸãã Pentahoã®ææçã«ã¯ç¬èªã®ã¯ã©ã€ã¢ã³ãããããCEã§ã¯Saikuãã©ã°ã€ã³ã䜿çšããŸããã
ãããã¡ãã¥ãŒã®Pentaho Marketplaceã¢ã€ãã ã«ç§»åããSaiku Analyticsãã€ã³ã¹ããŒã«ããŸãã
ããã§ãã¹ãŠã§ããåæçšã®ããŒã¿ãæºåããŸãã
ãã¡ã¯ãããŒãã«ãšæž¬å®å€ã®æºå
Pentahoã¯OLAPãã¯ãããžãŒã®ROLAPå®è£ ã§ãã åæãããã¹ãŠã®ããŒã¿ã¯éåžžã®ãªã¬ãŒã·ã§ãã«ããŒãã«ã«æ ŒçŽãããŸãããããããäœããã®æ¹æ³ã§äºåã«æºåãããŸãã ãããã£ãŠãå¿ èŠãªã®ã¯å¿ èŠãªããŒãã«ãäœæããããšã ãã§ãã
çµ±èšãå¿ èŠãªäž»é¡åéã«ã€ããŠå°ãã話ããŸãã ãŠã§ããµã€ããããã顧客ãããŠããããã®é¡§å®¢ãæžãããšãã§ãããã±ããããããŸãã ãŸããã³ã¡ã³ãä»ããã¯ãã ãããŠãç§ãã¡ã®ãµããŒãã¯ãããŸããŸãªãããã¯ããããžã§ã¯ããåœã«é¢ããããããã¹ãŠã®ãã±ãããç ŽããŸãã ãã®ãããããšãã°ãéå»1ãæéã«ãã€ãã®åãããžã§ã¯ããããé éããšãã件åã®ãã±ãããããã€å±ãããã調ã¹ãå¿ èŠããããŸããã ãããŠã管çè ãã€ãŸã 誰ããµããŒãããæ¥ããããã®ãããªãã±ãããããã€åŠçãããããªã©ã確èªããŸãã ãªã©
ãã®ãããªã¹ã©ã€ã¹ãšOLAPãã¯ãããžãŒã¯ãã¹ãŠå¯èœã§ãã OLAPã«ã€ããŠã¯è©³ãã説æããŸããã èªè ã¯OLAPãã¥ãŒãã枬å®å€ãããã³æž¬å®å€ã®æŠå¿µã«ç²ŸéããŠãããäžè¬çã«ã¯ãããäœã§ãããäœãé£ã¹ãŠããããæ³åããŠãããšæ³å®ããŠããŸãã
ãã¡ãããäŸãšããŠå®éã®ã¯ã©ã€ã¢ã³ãã®å®éã®ããŒã¿ãåæããããšã¯ãããŸããããã®ç®çã®ããã«ããµãã«ãŒã®çµ±èšæ å ±ãå«ãå°ããªãµã€ãã䜿çšããŸãã ããã«ããå®çšçãªå©ç¹ã¯ã»ãšãã©ãããŸãããããµã³ãã«ãšããŠã¯ããã§ãã
ãã¬ã€ã€ãŒããŒãã«ããããŸãã ååœã®ãã¬ãŒã€ãŒæ°ãã©ã€ã³ãããã®ãã¬ãŒã€ãŒæ°ãã¢ã¯ãã£ããªãã¬ãŒã€ãŒã®æ°ã30ã40æ³ã®ãã·ã¢ã®ããããã£ãŒã«ããŒã®æ°ãªã©ãããããçš®é¡ã®æçšãªçµ±èšæ å ±ãèŠã€ããŠã¿ãŸãããã ãŸãããã®ãããªãã®...
ã ããã©ãã§æ¢ããã®ïŒ ãããŠããŸãã«ãããŒãã«ã®æºåã ããã€ãã®æ¹æ³ããããŸãïŒæãšããåºãã®SQLããã¯ããŒã ã§ãã¹ãŠã®ããŒãã«ãåäœæãããã Pentaho Data IntegrationãŠãŒãã£ãªãã£ïŒPDIãå¥åKettleïŒ-ããŒã¿ã®æœåºãå€æãã¢ããããŒãã®ããã»ã¹ïŒETLïŒãæ åœããPentahoè€åã³ã³ããŒãã³ãã䜿çšããŸãã ç¹å®ã®ããŒã¿ããŒã¹ãšã®æ¥ç¶ã確ç«ããããŸããŸãªããŒã«ã䜿çšããŠãå¿ èŠãªããŒãã«ãæºåã§ããŸãã ããŠã³ããŒãããŠãã ãã ã mysqlã³ãã¯ã¿ãŒãlibãã©ã«ããŒã«ãããããã Spoon.batãä»ããŠPDIãå®è¡ããŸãã
ãŸããçµ±èšã®äžå¿ã§ãããã¬ã€ã€ãŒã®ããŒãã«ãåéããŸãããã æåã¯ããã®æ§é ã¯æ¬¡ã®ããã«ãªããŸãã
CREATE TABLE IF NOT EXISTS `player` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(40) DEFAULT NULL COMMENT '', `patronymic` varchar(40) DEFAULT NULL COMMENT '', `surname` varchar(40) DEFAULT NULL COMMENT '', `full_name` varchar(255) DEFAULT NULL COMMENT ' ', `birth_date` date NOT NULL COMMENT ' ', `death_date` date DEFAULT NULL COMMENT ' ', `main_country_id` int(11) unsigned NOT NULL COMMENT 'ID ', `birthplace` varchar(255) DEFAULT NULL COMMENT ' ', `height` tinyint(3) unsigned DEFAULT NULL COMMENT '', `weight` tinyint(3) unsigned DEFAULT NULL COMMENT '', `status` enum('active','inactive') NOT NULL DEFAULT 'active' COMMENT ' - , ..', `has_career` enum('no','yes') NOT NULL DEFAULT 'no' COMMENT ' ', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `surname` (`surname`), KEY `birth_date` (`birth_date`), KEY `death_date` (`death_date`), KEY `has_stat` (`has_career`), KEY `main_country_id` (`main_country_id`), KEY `status` (`status`), KEY `full_name_country_id` (`full_name_country_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='' AUTO_INCREMENT=1;
ããã€ãã®ãã£ãŒã«ãïŒååãå§ãæ称ãfull_nameãåºèº«å°ãªã©ïŒã¯çµ±èšã«ã¯å¿ èŠãããŸããã Enumã¿ã€ãã®ãã£ãŒã«ãïŒstatusãhas_careerïŒã¯ãåå¥ã®ãã£ã¡ã³ã·ã§ã³ããŒãã«ã«é 眮ããã¡ã€ã³ããŒãã«ã«å€éšããŒã®èå¥åãå ¥åããã ãã§ãã
ããã§ã¯ãå§ããŸãããïŒ ãã¡ã€ã«>æ°èŠ>ãžã§ã ïŒCtrl + Alt + NïŒã ãžã§ãã®ã¯ãŒã¯ã¹ããŒã¹ãéããŸãã [衚瀺]ã¿ãã«ç§»åããæ°ããããŒã¿ããŒã¹æ¥ç¶ãäœæããŸãïŒ ããŒã¿ããŒã¹æ¥ç¶>æ°èŠ ïŒïŒãµãŒããŒãããŒã¿ããŒã¹ããŠãŒã¶ãŒãããã³ãã¹ã¯ãŒããæäœããæ¥ç¶ã«ååãä»ãïŒfbplayersããããŸãïŒãä¿åããŸãïŒ cïŒ\ Pentaho \ biserver-ce \ pentaho -solutions \ jobs \ fbplayers.kjb ïŒã
å€æãäœæããŸãïŒã ãã¡ã€ã«ã>ãæ°èŠã>ãå€æã ãCtrl + NïŒã prepare_tables.ktrãšããŠä¿åããŸãã ãžã§ããšåãããã«ãå€æã®ããã«ããŒã¿ããŒã¹ãžã®æ¥ç¶ãè¿œå ããŸãã ã§ãã
[衚瀺]ã¿ãã«ç§»åãã[å ¥å]ã»ã¯ã·ã§ã³ãå±éããŸãã ããŒã¿ã°ãªããããŒã«ãéžæããŸãã å¥ã®é¢é£ããŒãã«ã§å°æ°ã®å¯èœãªãªãã·ã§ã³ãæã€ããã€ãã®ãã£ãŒã«ããåãåºãå¿ èŠãããå Žåã«é©ããŠããŸãã ãã®ãããããŒã¿ã°ãªãããã¯ãŒã¯ã¹ããŒã¹ã«åŒãåºããããã«ã¯ãªãã¯ããŠç·šéçšã«éããŸãã ãã®å€æã¹ãããã®ååïŒ Player Status ïŒãå ¥åãããã®ããŒãã«ã®æ§é ïŒ[ã¡ã¿]ã¿ãïŒãšããŒã¿èªäœïŒ[ããŒã¿]ã¿ãïŒã®èšå®ãéå§ããŸãã æ§é ã«ã¯2ã€ã®ãã£ãŒã«ãããããŸãã
1.åå-idãã¿ã€ã-æŽæ°ã10é²æ°-11
2.åå-ã¹ããŒã¿ã¹ãã¿ã€ã-ã¹ããªã³ã°ãé·ã-10ã
[ããŒã¿]ã¿ãã§ã1-ã¢ã¯ãã£ãã2-éã¢ã¯ãã£ãã®2è¡ãé§åããŸãã
[åºå]ã»ã¯ã·ã§ã³ã«ç§»åããããŒãã«åºåèŠçŽ ãåŒãåºããŸãã ããã«ã¯ãªãã¯ããŠãã¢ã€ãã åãPlayer Status Dimã«èšå®ããŸãã æ¥ç¶ã¯æ¬¡ã®è¡ã«è¡šç€ºãããŸãã [ã¿ãŒã²ããããŒãã«]ãã£ãŒã«ãã«ããã¬ã€ã€ãŒã®ã¹ããŒã¿ã¹ãä¿åããããã«ããŒã¿ããŒã¹ã«äœæãããããŒãã«ã®ååãå ¥åããŸãïŒplayer_status_dimã ãã§ãã¯ããã¯ã¹Truncate Tableãé 眮ããŸãã å ¥åèŠçŽ ãšåºåèŠçŽ ãæ¥ç¶ããŸããPlayerStatusãã¯ãªãã¯ããShiftãã¿ã³ãæŒããªãããããŠã¹ãPlayer Status Dimã«ãã©ãã°ããŸãã ãªã³ã¯ã¯ããããã®èŠçŽ ãçµã¶ç¢å°ãšããŠè¡šç€ºãããŸãã
åãããšã¯ããã£ãªã¢ã®æïŒ Player Career ïŒã§åããªããã°ãªããŸããïŒ
1.åå-idãã¿ã€ã-æŽæ°ã10é²æ°-11
2.åå-has_careerãã¿ã€ã-æååãé·ã-3ã
[ããŒã¿]ã¿ãã§ã1-ãããã2-ã¯ãã®2è¡ãé§åããŸãã
åæ§ã«ãåºåãã¬ãŒã€ãŒã®Career DimããŒãã«ãåéããŸãã
次ã«ããã¬ãŒã€ãŒã®èªçæ¥ãå¥ã®æž¬å®ããŒãã«ã«é 眮ããŸãã æŠããŠãPentahoã§ã¯ããã¡ã¯ãããŒãã«ã§æ¥ä»ãçŽæ¥äœ¿çšã§ããŸããæåã¯ããµããžã§ã¯ããšãªã¢ã®ããŒã¿ã䜿çšããŠãããè¡ããŸããã ããããããã€ãã®åé¡ããããŸããã
1. 2ã€ã®ç°ãªããã¡ã¯ãããŒãã«ïŒããšãã°ããã¬ãŒã€ãŒãšã³ãŒãïŒãç幎ææ¥ããšã«åå²ããå¿ èŠãããå Žåããããã«å ±éã®ãã£ã¡ã³ã·ã§ã³ïŒãã£ã¡ã³ã·ã§ã³ïŒãå¿ èŠã§ãã
2.ãã¡ã¯ãããŒãã«èªäœã®æ¥ä»ãæœåºãŸãã¯å¹ŽïŒæã...ïŒãªã©ã®é¢æ°ã®ã³ã³ããŒãã³ãéšåã«åå²ããå Žåã幎ãæãªã©ãååŸããããã«ããŒãã«ã®åè¡ã«é©çšãããŸãã æ°·ã§ã¯ãªããã®ã
ãã®ããããããã®çç±ãããå ã®æ§é ãåäœæããæéãæå°ã¬ãã«ã®ãŸãŸã«ããŠãæéã®äžæã®å€ããã¹ãŠå«ãããŒãã«ãäœæããŸããã ãã®ãã¹ãäŸã§ã¯ããã®ãããªè©³çŽ°ã¯ãªãã幎ãæãæ¥ã®ã¿ãå«ãŸããŸãã
æ°ããå€æïŒ initial_sql ïŒãäœæããŸãã æ¥ç¶ãå¿ããªãã§ãã ããã ã¢ã€ãã ã®ã³ã¬ã¯ã·ã§ã³ãããã ã¹ã¯ãªããã>ãSQLã¹ã¯ãªããã®å®è¡ ããéžæããŸãã æ¥ä»ããã«ãŒãæžã蟌ã¿ãŸãïŒ
DROP TABLE IF EXISTS `player_birth_date_dim`; CREATE TABLE IF NOT EXISTS `player_birth_date_dim` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `year` smallint(5) unsigned NOT NULL COMMENT '', `month` tinyint(2) unsigned NOT NULL COMMENT '', `day` tinyint(2) unsigned NOT NULL COMMENT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' ' AUTO_INCREMENT=1 ; INSERT INTO `player_birth_date_dim` (SELECT DISTINCT NULL, YEAR(p.birth_date) as `year`, MONTH(p.birth_date) as `month`, DAY(p.birth_date) as `day` FROM ( SELECT DISTINCT birth_date FROM player ) AS p)
ããã«ããã®å€æã§ãããã«2ã€ã®SQLã¹ã¯ãªãããäœæããŸã-ããŒãã«Player Career Dimããã³Player Status DimãäœæããããïŒ
DROP TABLE IF EXISTS player_career_dim; CREATE TABLE IF NOT EXISTS `player_career_dim` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `has_areer` varchar(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
DROP TABLE IF EXISTS player_status_dim; CREATE TABLE IF NOT EXISTS `player_status_dim` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `status` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ããã·ã§ã³ã®äž»èŠéšåã§ãããã¡ã¯ãããŒãã«ã®çµã¿ç«ãŠã«é²ã¿ãŸãã å€æãäœæããŸãïŒ player_fact.ktr ïŒã 圌ãã¯æ¥ç¶ãå¿ããŠããŸããã§ãããïŒ [å ¥å]ã¿ãããã[ããŒãã«å ¥å]ã[åºå]-[ããŒãã«åºå]ããããããã¹ããŒããŸãã ããŒãã«å ¥åã§ã¯ãã¯ãŒã«ãªSQLããã¯ããŒã ãèšè¿°ããŸãã
SELECT p.id AS player_id, dd.id AS birth_date_id, p.main_country_id, p.height, p.weight, CASE p.status WHEN 'active' THEN 1 WHEN 'inactive' THEN 2 END as status_id, CASE p.has_career WHEN 'no' THEN 1 WHEN 'yes' THEN 2 END as has_career_id FROM player AS `p` INNER JOIN player_birth_date_dim AS dd ON YEAR(p.birth_date) = dd.`year` AND MONTH(p.birth_date) = dd.`month` AND DAY(p.birth_date) = dd.`day`
ããŒãã«åºåã§ãããŒãã«å-player_factãæå®ããŸãã ãœãŒã¹ãšçµæã®ããŒãã«ãç¢å°ã§æ¥ç¶ããŸãã
åã³ä»äºã«è¡ããŸãã [å šè¬]ã¿ããããæ°ããå€æãè¿œå ããŸãã éããŠã Prepare Tablesãšããååãä»ããä¿åããå€æprepare_tables.ktrãžã®ãã¹ãæå®ããŸãã
Initial SQLããã³Player Factå€æã§ãåãããšãè¡ããŸã ã
ãã©ãŒã ã«[ã¹ã¿ãŒã]ãã¿ã³ããããããã次ã®é åºã§èŠçŽ ãæ¥ç¶ããŸãã [ã¹ã¿ãŒã]> [åæSQL]> [ããŒãã«ã®æºå]> [ãã¬ãŒã€ãŒãã¡ã¯ãã®ããŒã] ã
ããã§ãã¿ã¹ã¯ãå®è¡ã§ããŸãã ããŒã«ããŒã§ãç·è²ã®äžè§åœ¢ãã¯ãªãã¯ããŸãã æãååã«ãŸã£ãããªå ŽåãåèŠçŽ ã®æšªã«ç·è²ã®ãã§ãã¯ããŒã¯ã衚瀺ãããŸãã ãµãŒããŒã«ç§»åããŠããã¬ãŒããå®éã«äœæãããããšã確èªã§ããŸãã äœããããŸããããªãã£ãå Žåããã°ã«ã¯ãã¹ãŠã®çœªã瀺ãããŸãã
ãã¥ãŒããäœæãããµãŒããŒã«å ¬éããŸã
æºåãããããŒã¿ãã§ããã®ã§ãã€ãã«OLAPã䜿çšããŸãã Pentahoã«ã¯ãolapãã¥ãŒããäœæããSchema WorkbenchãŠãŒãã£ãªãã£ããããŸãã mysqlã³ãã¯ã¿ãããŠã³ããŒãããŠè§£åãããã©ã€ããŒãã©ã«ããŒã«ããããããŠã workbench.batãå®è¡ããŸã ã
ããã«[ãªãã·ã§ã³ ] > [æ¥ç¶ ]ã¡ãã¥ãŒã«ç§»åããŸãã ããŒã¿ããŒã¹æ¥ç¶ãã©ã¡ãŒã¿ãŒãå ¥åããŸãã
ã¯ããã«ïŒ File> New> Schema ã ã¹ããŒã ãããã«ä¿åããŸãïŒ fbplayers.xmlããããŸã ïŒã ã¹ããŒã ã®ååãèšå®ããŸãã
åè·¯ã®ã³ã³ããã¹ãã¡ãã¥ãŒã䜿çšããŠããã¥ãŒããäœæããŸãã çµ±èšãèæ ®ãããšã³ãã£ãã£ã®ååãã€ãŸã ãã¬ã€ã€ãŒ
ãã¥ãŒãå ã§ããã¡ã¯ãããŒãã«player_factã«ãªãããŒãã«ã瀺ããŸãã
Playerãã¥ãŒããéžæãããšãå³åŽã®ãã€ã³ã®äžéšã«ããèµ€ãç·ã¯ããã¥ãŒãã«ãã£ã¡ã³ã·ã§ã³ãèšå®ããå¿ èŠãããããšã瀺ããŸãã ããŒã¿ã¹ã©ã€ã¹ãå®è¡ããããã©ã¡ãŒã¿ã
ãã¥ãŒãã®ãã£ã¡ã³ã·ã§ã³ãèšå®ããã«ã¯ã2ã€ã®æ¹æ³ããããŸãïŒãã¥ãŒãå ã§çŽæ¥ïŒ ãã£ã¡ã³ã·ã§ã³ã®è¿œå ãäœ¿çš ïŒããã³åè·¯å ïŒåè·¯ã®ãã£ã¡ã³ã·ã§ã³ã®è¿œå ãšãã¥ãŒãèªäœã®ãã£ã¡ã³ã·ã§ã³äœ¿çšã®è¿œå ïŒã çµ±èšã§ã¯2çªç®ã®ãªãã·ã§ã³ã䜿çšããŸããã ããã«ããã1ã€ã®ãã£ã¡ã³ã·ã§ã³ãè€æ°ã®ãã¡ã¯ãããŒãã«ïŒäžåºŠã«è€æ°ã®ãã¥ãŒãïŒã«é©çšã§ããŸãã 次ã«ããããã®ãã¥ãŒããä»®æ³ãã¥ãŒãã«çµåããè€æ°ã®ãã¥ãŒãã®çµ±èšãåæã«è¡šç€ºã§ããããã«ããŸããã
ãã¹ããããžã§ã¯ãã§ã¯ãä»®æ³ãã¥ãŒããäœæããªãéãã2çªç®ã®æ¹æ³ã䜿çšããŸãã
ãã®ãããæåã®åœãè¿œå ããŸãã ã¹ããŒããã£ã¡ã³ã·ã§ã³ãäœæãã Countryãšããååãä»ããŸãã ãã®äžã«ã¯ãã§ã«1ã€ã®éå±€ãããã Country_Hierarchyãšããååãä»ããŸãã ãã®éå±€ã§ã¯ãCountryãã£ã¡ã³ã·ã§ã³ã®å€ãæ ŒçŽããããŒãã«ãè¿œå ããŸãã åœã
ããã¯ã次ã®æ§é ãæã€åœã®ãªã¹ããæã€éåžžã®mysqlããŒãã«ã§ãã
CREATE TABLE IF NOT EXISTS `country` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(40) NOT NULL COMMENT '', `english_name` varchar(40) NOT NULL COMMENT ' ', `iso_alpha_3` varchar(3) NOT NULL COMMENT ' ISO 3166-1', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `england_name` (`english_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='' AUTO_INCREMENT=1 ;
ãã®åŸãéå±€1ã¬ãã«ïŒã¬ãã«ã®è¿œå ïŒã«è¿œå ããŸãã Country_LevelãšåŒã³ããã¡ã¯ãããŒãã«ããã®ãã£ã¡ã³ã·ã§ã³ããŒãã«ã«é¢é£ä»ããŸããããŒãã«ãã£ãŒã«ããåœã«ãåãidã«ãnameColumnãnameã«èšå®ããŸãã ã€ãŸã ããã¯ããã¡ã¯ãããŒãã«ããåœIDãæ¯èŒãããšãã«ãçµæãšããŠåœåãåœããŒãã«ããè¿ãããšãæå³ããŸãïŒèªã¿ãããããããïŒã ååãšããŠãæ®ãã®ãã£ãŒã«ãã¯ç©ºçœã®ãŸãŸã«ã§ããŸãã
ããã§ãPlayerãã¥ãŒãã«æ»ã£ãŠãæ°ããäœæããããã£ã¡ã³ã·ã§ã³ãå²ãåœãŠãããšãã§ããŸãïŒãã£ã¡ã³ã·ã§ã³äœ¿çšã®è¿œå ã䜿çšïŒã ååïŒåœïŒãèšå®ãããœãŒã¹ã¯äœæããã枬å®åœïŒããããããŠã³ãªã¹ãã§ã¯ãããŸã§å¯äžã®ãã®ã§ãïŒãforeignKeyãã£ãŒã«ãã¯main_country_idã§ãã ããã«ãããPentahoã¯ããã¡ã¯ãããŒãã«ã«main_country_idãèŠã€ãããšãæå®ãããåïŒidïŒã®ãã£ã¡ã³ã·ã§ã³ããŒãã«ïŒCountryïŒã«ã¢ã¯ã»ã¹ããname_nameãmain_country_idã«çœ®ãæããŸãã ãã®ãããªãã®...
å®éã«äœããéçŽããããã¥ãŒãã瀺ãããã ãã«æ®ã£ãŠããŸãïŒïŒãã¥ãŒãã«ã¡ãžã£ãŒãè¿œå ããŸãïŒ ã¡ãžã£ãŒã®è¿œå ïŒã PlayerCountãšããååãaggregator-distinct-countãéèšãããã£ãŒã«ã-player_idãšããååãä»ããŸãããã ã§ããïŒ
å°ãã®éããã詳ããèŠãŠãããã§ç§ãã¡ãäœãæãèµ·ããããããã§ãã¯ããŸãããã Pentaho Webãã§ã€ã¹ãèµ·åããŸãã
localhost:8080/pentaho
localhost:8080/pentaho
ïŒstart-pentaho.batãå¿ããªãã§ãã ããïŒã [ãã¡ã€ã«]> [管ç]> [ããŒã¿ãœãŒã¹]ã«ç§»åããŸã ã ãã¿ã³ãã¯ãªãã¯ããŠãæ°ãããœãŒã¹ãè¿œå ããŸãã ã¿ã€ã-ããŒã¿ããŒã¹ããŒãã«ãéžæããŸãã ããã§å¿ èŠãªæãéèŠãªããšã¯ãæ°ããæ¥ç¶ãäœæããããšã§ãã ååïŒFbplayersïŒãèšå®ããããŒã¿ãé§åããŠããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ããŸãã Connectionãä¿åããããã©ãã§ã[ãã£ã³ã»ã«]ãã¯ãªãã¯ããŸããä»ã«äœãå¿ èŠãããŸããã
次ã«ãäœæããã¹ããŒã ãPentahoãµãŒããŒã§å ¬éããå¿ èŠããããŸãïŒ File> Publish ã URLãèšå®ïŒ
localhost:8080/pentaho
localhost:8080/pentaho
ããã³å ¬éãããã¹ã¯ãŒããå ¥åããŸãã ãã®ãã¹ã¯ãŒãã¯ããã¡ã€ã«cïŒ\ Pentaho \ biserver-ce \ pentaho-solutions \ system \ publisher_config.xmlã§èšå®ãããŸãã ãã®ãã¹ã¯ãŒãã123ã«èšå®ããŸããããšãã°ããŠãŒã¶ãŒãšãã¹ã¯ãŒãã¯æšæº-joe / passwordã§ãã ãã¹ãŠãæ£åžžã§ããã°ããã®åŸãã¹ããŒã ãä¿åãããã©ã«ããŒãéžæããããã®ãŠã£ã³ããŠã衚瀺ãããŸãã æåŸã®æé ã§äœæããæ¥ç¶ã®ååïŒFbplayersïŒã[PentahoãŸãã¯JNDIãœãŒã¹]ãã£ãŒã«ãã«å ¥åããŸãã ã¹ããŒããã©ã«ããŒãäœæãããã¡ã€ã«ãä¿åããŸãã ãã¹ãŠãããŸãããã°ã楜ãããŠã£ã³ããŠã衚瀺ãããã¯ãã§ãã
èŠã«è¡ããïŒ Webãã§ã€ã¹ã«ç§»åããŠSaikuãéããããããããŠã³ãªã¹ããããã¥ãŒããéžæããŸãã Countryãã£ã¡ã³ã·ã§ã³ãšPlayerCountã¡ãžã£ãŒã衚瀺ãããŸãã Rowsãã£ãŒã«ãã«Country_LevelããColumnsã«PlayerCountããã©ãã°ããŸãã ããã©ã«ãã§ã¯ãSaikuããã«ã®èªåã¯ãšãªå®è¡ã®ãã¿ã³ãæŒãããŠããŸãã éåžžã枬å®å€ãšæž¬å®å€ããã©ãã°ããåã«çµãåºãå¿ èŠããããŸãããããã¯éèŠã§ã¯ãããŸããã èªåå®è¡ãç¡å¹ã«ãªã£ãŠããå Žåã¯ã[å®è¡]ãã¿ã³ãã¯ãªãã¯ããŸãã åã¶ïŒ
ããããçªç¶çŸããããŒã¿ã®ä»£ããã«ããEOFExceptionïŒãµãŒããŒããã®å¿çãèªã¿åããŸããã äºæããæ¥ç¶ã倱ãããåã«4ãã€ããèªãã0ãã€ããèªããšäºæ³ãããŸãããå¿é ããªãã§ãã ããã
枬å®ãã¿ã³ã®ç¢å°ãã¯ãªãã¯ãããšãçµæã®éžæãéé ãŸãã¯æé ã§äžŠã¹æ¿ããããšãã§ããŸãã
å°ãããŒã¿ããããŸããããŸã å©çšå¯èœãªãã®ãèŠãŠã¿ãŸãããã ããšãã°ãåœããšã«æåAã«ã®ã¿åºåããŒã¿ãå¶éããããšãã§ããŸãã
ååŸãããã®ïŒ
ã°ã©ããèŠãããšãã§ããŸãã ãµã³ãã«ã«ããŒã¿ãã»ãšãã©ãªãå Žåãããã¯éåžžçŸããã§ãã
ãµã³ãã«ã®çµ±èšãèŠãããšãã§ããŸãïŒæå°å€ãæ倧å€ãå¹³åå€ãªã©ã ãã®ããããã£ã¯ãã¹ãŠxlsãŸãã¯csvã«ã¢ããããŒãã§ããŸãã ãŸããã³ã³ã¹ãã©ã¯ã¿ãŒã䜿çšããŠã¹ããŒããããªã¯ãšã¹ãã¯ãµãŒããŒã«ä¿åã§ãããããåŸã§æ»ãããšãã§ããŸãã
ãããã£ãŠãæ¬è³ªã¯æããã§ãã ããã«ããã€ãã®ãã£ã¡ã³ã·ã§ã³ãäœæããŸãããã ååãšããŠããã¬ãŒã€ãŒã®ã¹ããŒã¿ã¹ãšãã£ãªã¢ã«ãã枬å®å€ã¯ãåœã«ãã枬å®å€ãšå€ãããŸããã ãããŠãäž¡æ¹ã®å Žåã®çµæã¯2è¡ã®ã¿ã§ãïŒã¢ã¯ãã£ã/éã¢ã¯ãã£ãã§ããããã/ãªãïŒã
Dateåã®éå±€ã®ç¶æ³ã¯ãã¯ããã«èå³æ·±ããã®ã§ãã ããã§äœæããŸãã ã¯ãŒã¯ãã³ãã«æ»ããæ°ãããã£ã¡ã³ã·ã§ã³ïŒ BirthDate ïŒãè¿œå ããŸãã StandardDimensionã®ä»£ããã«ããã©ã¡ãŒã¿ãŒTimeDimensionãèšå®ããŸãã ããã«ã¯ãã§ã«éå±€ããããŸãã ãã£ã¡ã³ã·ã§ã³ããŒãã«player_birth_date_dimãè¿œå ããŸãã
æåã®ã¬ãã«-Yearãè¿œå ããŸãã ããŒãã«= player_birth_date_dimãå= idãlevelType = TimeYearsãèšå®ããŸãã ãã®ã¬ãã«ã§ã¯ããåŒãããããã£ã«ã幎ãã®å€ãè¿œå ããŸãã
2çªç®ã®ã¬ãã«ã§ããMonthãè¿œå ããŸãã ããŒãã«= player_birth_date_dimãå= idãlevelType = TimeMonthsãèšå®ããŸãã ãã®ã¬ãã«ã§ã¯ãå€ããmonthãã®ããŒåŒããããã£ãå€ããCONCATïŒ `year`ã 'ã'ãMONTHNAMEïŒSTR_TO_DATEïŒ` month`ã 'ïŒ m'ïŒïŒïŒãã®ãã£ãã·ã§ã³åŒãè¿œå ããŸãã
3çªç®ã®ã¬ãã«ã§ããDayãè¿œå ããŸãã ããŒãã«= player_birth_date_dimãå= idãlevelType = TimeDaysãèšå®ããŸãã ãã®ã¬ãã«ã§ã¯ããCONCATïŒLPADïŒ `day`ã2ã0ïŒã 'ã'ãLPADïŒ` month`ã2ã0ïŒã 'ã'ã `Year`ïŒããšããå€ãæã€Caption Expressionããããã£ãè¿œå ããŸãã
äœæãããã£ã¡ã³ã·ã§ã³ããã¥ãŒãã«è¿œå ããbith_date_idãforeignKeyãšããŠæå®ããŸãã
ãããªãã·ã¥ã çãŸãã幎ãŸã§ã«ãã¹ãŠã®ãã¬ãŒã€ãŒãå£ããŠã¿ãŸãããã
ãããŠãã幎ããã©ã¡ãŒã¿ã«ãæããã©ã¡ãŒã¿ãè¿œå ããŸãã Pentahoã¯ãå幎ãæã«åå²ããå幎ã®ç¹å®ã®æã«çãŸãããã¬ãŒã€ãŒã®æ°ãèšç®ããŸãã ããã©ã«ãã§ã¯ãæããšã®ããŒã¿ã®ã¿ã衚瀺ãããŸãããããŒã«ããŒã®ã芪ãé ãããã¿ã³ãæŒããšãç¹å®ã®å¹Žã®ãã¬ãŒã€ãŒã®ç·æ°ãèŠãããšãã§ããŸãã
ããããPentahoãããã³å®éã«ã¯OLAPå šäœã®äž»ãªåŒ·ã¿ã¯ãå®éã«ã¯ãã®ãããªåçŽãªãµã³ãã«ã§ã¯ãªããåæã«ããã€ãã®æž¬å®ããã®ã¹ã©ã€ã¹ã«ãããŸãã ã€ãŸã , , 1990 .
, .
- . , - - OLAP , , .