You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2018/07/02 06:08:51 UTC
svn commit: r1834820 [17/48] - in /kylin/site: ./ about/ blog/
blog/2015/01/25/introduce-data-model/
blog/2015/06/10/release-v0.7.1-incubating/
blog/2015/08/13/kylin-dictionary/ blog/2015/08/15/fast-cubing/
blog/2015/09/06/release-v1.0-incubating/ blog...
Added: kylin/site/cn/docs23/tutorial/cube_streaming.html
URL: http://svn.apache.org/viewvc/kylin/site/cn/docs23/tutorial/cube_streaming.html?rev=1834820&view=auto
==============================================================================
--- kylin/site/cn/docs23/tutorial/cube_streaming.html (added)
+++ kylin/site/cn/docs23/tutorial/cube_streaming.html Mon Jul 2 06:08:48 2018
@@ -0,0 +1,4658 @@
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<!doctype html>
+<html>
+ <!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <title>Apache Kylin | ä» Kafka æµæ建 Cube</title>
+ <meta name="description" content="Apache Kylin Home">
+ <meta name="author" content="Apache Kylin">
+ <link rel="shortcut icon" href="fav.png" type="image/png">
+
+
+
+<link rel="stylesheet" href="/assets/css/animate.css">
+<!-- Bootstrap -->
+<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
+
+<!-- Fonts -->
+<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Alice|Open+Sans:400,300,700"> -->
+
+<!-- Icons -->
+<link rel="stylesheet" href="/assets/css/font-awesome.min.css">
+
+ <!-- Custom styles -->
+ <link rel="stylesheet" href="/assets/css/styles.css">
+ <link rel="stylesheet" href="/assets/css/docs.css">
+
+ <link rel="canonical" href="http://kylin.apache.org/cn/docs23/tutorial/cube_streaming.html">
+ <link rel="alternate" type="application/rss+xml" title="Apache Kylin" href="http://kylin.apache.org/feed.xml" />
+
+<!--[if lt IE 9]> <script src="assets/js/html5shiv.js"></script> <![endif]-->
+<!-- Global site tag (gtag.js) - Google Analytics -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120788561-1"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', 'UA-120788561-1');
+</script>
+<script type="text/javascript" src="/assets/js/jquery-1.9.1.min.js"></script>
+<script type="text/javascript" src="/assets/js/nside.js"></script> </script>
+<script type="text/javascript" src="/assets/js/nnav.js"></script> </script>
+<script>
+var _hmt = _hmt || [];
+(function() {
+ var hm = document.createElement("script");
+ hm.src = "https://hm.baidu.com/hm.js?bdc5e03add430c0b72cc0eb91eabfa99";
+ var s = document.getElementsByTagName("script")[0];
+ s.parentNode.insertBefore(hm, s);
+})();
+</script>
+</head>
+
+ <body>
+ <!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<header id="header" >
+ <!-- Main Menu -->
+ <nav class="navbar navbar-default" role="navigation" id="nav-wrapper">
+ <div class="container-fluid" id="nav">
+ <!-- Brand and toggle get grouped for better mobile display -->
+ <div class="navbar-header">
+ <img class="navbar-logo" width="46" src="/assets/images/kylin_logo.png "></img>
+
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <ul class="nav icon-navbar">
+ <li><a href="https://twitter.com/apachekylin" target="_blank" class="fa fa-twitter fa-lg" title="Twitter: @ApacheKylin" ></a></li>
+ <li><a href="https://github.com/apache/kylin" target="_blank" class="fa fa-github-alt fa-lg" title="Github: apache/kylin" ></a></li>
+ <li><a href="https://www.facebook.com/kylinio" target="_blank" class="fa fa-facebook fa-lg" title="Facebook: kylin.io" ></a></li>
+ </ul>
+ </div>
+
+ <!-- Collect the nav links, forms, and other content for toggling -->
+ <div class="navbar-collapse" id="bs-example-navbar-collapse-1">
+ <ul class="nav navbar-nav">
+ <li><a href="/cn">é¦é¡µ</a></li>
+ <li><a href="/cn/docs" >ææ¡£</a></li>
+ <li><a href="/cn/download">ä¸è½½</a></li>
+ <li><a href="/community" >社åº</a></li>
+ <li><a href="/development" >å¼å</a></li>
+ <li><a href="/blog">å客</a></li>
+ <li><a href="/" >English</a></li>
+ </ul>
+
+
+ </div><!-- /.navbar-collapse -->
+ </div><!-- /.container-fluid -->
+ </nav>
+
+ <div id="head" class="parallax normal-header" >
+ <div class="text-center header-apache">
+ <a href="http://apache.org/foundation/contributing.html" title="Support Apache" style="margin-left: 150px;">
+ <div>
+ <img src="https://www.apache.org/images/SupportApache-small.png">
+ </div>
+ </a>
+ </div>
+ </div>
+
+ </header>
+
+
+ <div class="container">
+ <div class="row" style="clear:both;">
+ <div class="col-md-8 col-lg-8 col-xs-12 col-sm-12 aside2" style="float:right;">
+ <div id="container" class="docs">
+ <div id="pjax">
+ <h1 class="post-title">ä» Kafka æµæ建 Cube</h1>
+ <article class="post-content" >
+ <p>Kylin v1.6 åå¸äºå¯æ©å±ç streaming cubing åè½ï¼å®å©ç¨ Hadoop æ¶è´¹ Kafka æ°æ®çæ¹å¼æ建 cubeï¼æ¨å¯ä»¥æ¥ç <a href="/blog/2016/10/18/new-nrt-streaming/">è¿ç¯å客</a> 以è¿è¡é«çº§å«ç设计ãæ¬ææ¡£æ¯ä¸æ¥æ¥ä¸æ¥çéè¿°å¦ä½å建åæå»ºæ ·ä¾ cube çæç¨;</p>
+
+<h2 id="section">åæåå¤</h2>
+<p>æ¨éè¦ä¸ä¸ªå®è£
äº kylin v1.6.0 æ以ä¸çæ¬åå¯è¿è¡ç Kafkaï¼v0.10.0 æ以ä¸çæ¬ï¼ç Hadoop ç¯å¢ï¼å
åç Kylin çæ¬æä¸å®çé®é¢å æ¤è¯·é¦å
å级æ¨ç Kylin å®ä¾ã</p>
+
+<p>æ¬æç¨ä¸æä»¬ä½¿ç¨ Hortonworks HDP 2.2.4 Sandbox VM + Kafka v0.10.0(Scala 2.10) ä½ä¸ºç¯å¢ã</p>
+
+<h2 id="kafka-01000--kylin">å®è£
Kafka 0.10.0.0 å Kylin</h2>
+<p>ä¸è¦ä½¿ç¨ HDP 2.2.4 èªå¸¦ç Kafkaï¼å 为å®å¤ªæ§äºï¼å¦æå
¶è¿è¡ç请å
åæã</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">curl -s http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/0.10.0.0/kafka_2.10-0.10.0.0.tgz | tar -xz -C /usr/local/
+
+cd /usr/local/kafka_2.10-0.10.0.0/
+
+bin/kafka-server-start.sh config/server.properties &</code></pre></div>
+
+<p>ä»ä¸è½½é¡µä¸è½½ Kylin v1.6ï¼å¨ /usr/local/ æ件夹ä¸è§£å tar å
ã</p>
+
+<h2 id="kafka-topic-">åå»ºæ ·ä¾ Kafka topic 并填å
æ°æ®</h2>
+
+<p>åå»ºæ ·ä¾å为 âkylin_streaming_topicâ å
·æä¸ä¸ªååºç topic:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic kylin_streaming_topic
+Created topic "kylin_streaming_topic".</code></pre></div>
+
+<p>å°æ ·ä¾æ°æ®æ¾å
¥ topicï¼Kylin æä¸ä¸ªå®ç¨ç±»å¯ä»¥åè¿é¡¹å·¥ä½;</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">export KAFKA_HOME=/usr/local/kafka_2.10-0.10.0.0
+export KYLIN_HOME=/usr/local/apache-kylin-2.1.0-bin
+
+cd $KYLIN_HOME
+./bin/kylin.sh org.apache.kylin.source.kafka.util.KafkaSampleProducer --topic kylin_streaming_topic --broker localhost:9092</code></pre></div>
+
+<p>å·¥å
·æ¯ä¸ç§ä¼å Kafka åé 100 æ¡è®°å½ãç´è³æ¬æç¨ç»æ请让å
¶ä¸ç´è¿è¡ãç°å¨æ¨å¯ä»¥ç¨ kafka-console-consumer.sh æ¥çæ ·ä¾æ¶æ¯:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">cd $KAFKA_HOME
+bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic kylin_streaming_topic --from-beginning
+{"amount":63.50375137330458,"category":"TOY","order_time":1477415932581,"device":"Other","qty":4,"user":{"id":"bf249f36-f593-4307-b156-240b3094a1c3","age":21,"gender":"Male"},"currency":"USD","country":"CHINA"}
+{"amount":22.806058795736583,"category":"ELECTRONIC","order_time":1477415932591,"device":"Andriod","qty":1,"user":{"id":"00283efe-027e-4ec1-bbed-c2bbda873f1d","age":27,"gender":"Female"},"currency":"USD","country":"INDIA"}</code></pre></div>
+
+<h2 id="streaming-">ç¨ streaming å®ä¹ä¸å¼ 表</h2>
+<p>ç¨ â$KYLIN_HOME/bin/kylin.sh startâ å¯å¨ Kylin æå¡å¨ï¼è¾å
¥ http://sandbox:7070/kylin/ ç»é Kylin Web GUIï¼éæ©ä¸ä¸ªå·²åå¨ç project æå建ä¸ä¸ªæ°ç projectï¼ç¹å» âModelâ -> âData Sourceâï¼ç¹å» âAdd Streaming Tableâ å¾æ ;</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/1_Add_streaming_table.png" alt="" /></p>
+
+<p>å¨å¼¹åºç对è¯æ¡ä¸ï¼è¾å
¥æ¨ä» kafka-console-consumer ä¸è·å¾çæ ·ä¾è®°å½ï¼ç¹å» â»â æé®ï¼Kylin ä¼è§£æ JSON æ¶æ¯å¹¶ååºææçæ¶æ¯;</p>
+
+<p>æ¨éè¦ä¸ºè¿ä¸ª streaming æ°æ®æºèµ·ä¸ä¸ªé»è¾è¡¨åï¼è¯¥ååä¼å¨åç»ç¨äº SQL æ¥è¯¢ï¼è¿éæ¯å¨ âTable Nameâ å段è¾å
¥ âSTREAMING_SALES_TABLEâ ä½ä¸ºæ ·ä¾ã</p>
+
+<p>æ¨éè¦éæ©ä¸ä¸ªæ¶é´æ³å段ç¨æ¥æ è¯æ¶æ¯çæ¶é´ï¼Kylin å¯ä»¥ä»è¿åå¼ä¸è·å¾å
¶ä»æ¶é´å¼ï¼å¦ âyear_startâï¼âquarter_startâï¼è¿ä¸ºæ¨æ建åæ¥è¯¢ cube æä¾äºæ´é«ççµæ´»æ§ãè¿éå¯ä»¥æ¥ç âorder_timeâãæ¨å¯ä»¥åæ¶éæ©é£äº cube ä¸éè¦çå±æ§ãè¿éæ们ä¿çäºææå段ã</p>
+
+<p>注æ Kylin ä» 1.6 çæ¬å¼å§æ¯æç»æå (æ称为 âåµå
¥â) æ¶æ¯ï¼ä¼å°å
¶è½¬æ¢æä¸ä¸ª flat table structureãé»è®¤ä½¿ç¨ â_â ä½ä¸ºç»æåå±æ§çåé符ã</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/2_Define_streaming_table.png" alt="" /></p>
+
+<p>ç¹å» âNextâãå¨è¿ä¸ªé¡µé¢ï¼æä¾äº Kafka é群信æ¯ï¼è¾å
¥ âkylin_streaming_topicâ ä½ä¸º âTopicâ åï¼é群æ 1 个 brokerï¼å
¶ä¸»æºå为 âsandboxâï¼ç«¯å£ä¸º â9092âï¼ç¹å» âSaveâã</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/3_Kafka_setting.png" alt="" /></p>
+
+<p>å¨ âAdvanced settingâ é¨åï¼âtimeoutâ å âbuffer sizeâ æ¯å Kafka è¿è¡è¿æ¥çé
ç½®ï¼ä¿çå®ä»¬ã</p>
+
+<p>å¨ âParser Settingâï¼Kylin é»è®¤æ¨çæ¶æ¯ä¸º JSON æ ¼å¼ï¼æ¯ä¸ä¸ªè®°å½çæ¶é´æ³å (ç± âtsColNameâ æå®) æ¯ bigint (æ°çºªå
æ¶é´) ç±»åå¼ï¼å¨è¿ä¸ªä¾åä¸ï¼æ¨åªé设置 âtsColumnâ 为 âorder_timeâï¼</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/3_Paser_setting.png" alt="" /></p>
+
+<p>å¨ç°å®æ
åµä¸å¦ææ¶é´æ³å¼ä¸º string å¦ âJul 20ï¼2016 9:59:17 AMâï¼æ¨éè¦ç¨ âtsParserâ æå®è§£æç±»åæ¶é´æ¨¡å¼ä¾å¦:</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/3_Paser_time.png" alt="" /></p>
+
+<p>ç¹å» âSubmitâ ä¿å设置ãç°å¨ âStreamingâ 表就å建好äºã</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/4_Streaming_table.png" alt="" /></p>
+
+<h2 id="section-1">å®ä¹æ°æ®æ¨¡å</h2>
+<p>æäºä¸ä¸æ¥å建ç表ï¼ç°å¨æ们å¯ä»¥å建æ°æ®æ¨¡åäºãæ¥éª¤åæ¨å建æ®éæ°æ®æ¨¡åæ¯ä¸æ ·çï¼ä½æ两个è¦æ±:</p>
+
+<ul>
+ <li>Streaming Cube ä¸æ¯æä¸ lookup 表è¿è¡ joinï¼å½å®ä¹æ°æ®æ¨¡åæ¶ï¼åªéæ© fact 表ï¼ä¸é lookup 表;</li>
+ <li>Streaming Cube å¿
é¡»è¿è¡ååºï¼å¦ææ¨æ³è¦å¨åé级å«å¢éçæ建 Cubeï¼éæ© âMINUTE_STARTâ ä½ä¸º cube çååºæ¥æåãå¦ææ¯å¨å°æ¶çº§å«ï¼éæ© âHOUR_STARTâã</li>
+</ul>
+
+<p>è¿éæ们éæ© 13 个 dimension å 2 个 measure å:</p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/5_Data_model_dimension.png" alt="" /></p>
+
+<p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/6_Data_model_measure.png" alt="" /><br />
+ä¿åæ°æ®æ¨¡åã</p>
+
+<h2 id="cube">å建 Cube</h2>
+
+<p>Streaming Cube åæ®éç cube 大è´ä¸ä¸æ ·. æ以ä¸å ç¹éè¦æ¨æ³¨æ:</p>
+
+<ul>
+ <li>ååºæ¶é´ååºè¯¥æ¯ Cube çä¸ä¸ª dimensionãå¨ Streaming OLAP ä¸æ¶é´æ»æ¯ä¸ä¸ªæ¥è¯¢æ¡ä»¶ï¼Kylin å©ç¨å®æ¥ç¼©å°æ«æååºçèå´ã</li>
+ <li>ä¸è¦ä½¿ç¨ âorder_timeâ ä½ä¸º dimension å 为å®é常çç²¾ç»ï¼å»ºè®®ä½¿ç¨ âmintue_startâï¼âhour_startâ æå
¶ä»ï¼åå³äºæ¨å¦ä½æ£æ¥æ°æ®ã</li>
+ <li>å®ä¹ âyear_startâï¼âquarter_startâï¼âmonth_startâï¼âday_startâï¼âhour_startâï¼âminute_startâ ä½ä¸ºå±çº§ä»¥åå°ç»å计ç®ã</li>
+ <li>å¨ ârefersh settingâ è¿ä¸æ¥ï¼å建æ´å¤å并çèå´ï¼å¦ 0.5 å°æ¶ï¼4 å°æ¶ï¼1 天ï¼ç¶åæ¯ 7 天ï¼è¿å°ä¼å¸®å©æ¨æ§å¶ cube segment çæ°éã</li>
+ <li>
+ <p>å¨ ârowkeysâ é¨åï¼ææ½ âminute_startâ å°æä¸é¢çä½ç½®ï¼å¯¹äº streaming æ¥è¯¢ï¼æ¶é´æ¡ä»¶ä¼ä¸ç´æ¾ç¤ºï¼å°å
¶æ¾å°åé¢å°ä¼å¸®å©æ¨ç¼©å°æ«æèå´ã</p>
+
+ <p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/8_Cube_dimension.png" alt="" /></p>
+
+ <p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/9_Cube_measure.png" alt="" /></p>
+
+ <p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/10_agg_group.png" alt="" /></p>
+
+ <p><img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/11_Rowkey.png" alt="" /></p>
+ </li>
+</ul>
+
+<p>ä¿å cubeã</p>
+
+<h2 id="build">è¿è¡ build</h2>
+
+<p>æ¨å¯ä»¥å¨ web GUI 触å buildï¼éè¿ç¹å» âActionsâ -> âBuildâï¼æç¨ âcurlâ å½ä»¤åéä¸ä¸ªè¯·æ±å° Kylin RESTful API:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">curl -X PUT --user ADMIN:KYLIN -H "Content-Type: application/json;charset=utf-8" -d '{ "sourceOffsetStart": 0ï¼"sourceOffsetEnd": 9223372036854775807ï¼"buildType": "BUILD"}' http://localhost:7070/kylin/api/cubes/{your_cube_name}/build2</code></pre></div>
+
+<p>请注æ API ç»ç«¯åæ®é cube ä¸ä¸æ · (è¿ä¸ª URL 以 âbuild2â ç»å°¾)ã</p>
+
+<p>è¿éç 0 表示ä»æåä¸ä¸ªä½ç½®å¼å§ï¼9223372036854775807 (Long ç±»åçæ大å¼) è¡¨ç¤ºå° Kafka topic çç»æä½ç½®ãå¦æè¿æ¯ç¬¬ä¸æ¬¡ build (没æ以åç segment)ï¼Kylin å°ä¼å¯»æ¾ topics çå¼å¤´ä½ä¸ºå¼å§ä½ç½®ã</p>
+
+<p>å¨ âMonitorâ 页é¢ï¼ä¸ä¸ªæ°ç job çæäºï¼çå¾
å
¶ç´å° 100% å®æã</p>
+
+<h2 id="insight--sql-">ç¹å» âInsightâ æ ç¾ï¼ç¼å SQL è¿è¡ï¼ä¾å¦:</h2>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">select minute_startï¼count(*)ï¼sum(amount)ï¼sum(qty) from streaming_sales_table group by minute_start order by minute_start</code></pre></div>
+
+<p>ç»æå¦ä¸ã<br />
+<img src="/images/tutorial/1.6/Kylin-Cube-Streaming-Tutorial/13_Query_result.png" alt="" /></p>
+
+<h2 id="build-1">èªå¨ build</h2>
+
+<p>ä¸æ¦ç¬¬ä¸ä¸ª build åæ¥è¯¢æåäºï¼æ¨å¯ä»¥æç
§ä¸å®çé¢çè°åº¦å¢é buildãKylin å°ä¼è®°å½æ¯ä¸ä¸ª build ç offsetsï¼å½æ¶å°ä¸ä¸ª build 请æ±ï¼å®å°ä¼ä»ä¸ä¸ä¸ªç»æçä½ç½®å¼å§ï¼ç¶åä» Kafka è·åææ°ç offsetsãæäº REST API æ¨å¯ä»¥ä½¿ç¨ä»»ä½å Linux cron è°åº¦å·¥å
·è§¦åå®:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">crontab -e
+*/5 * * * * curl -X PUT --user ADMIN:KYLIN -H "Content-Type: application/json;charset=utf-8" -d '{ "sourceOffsetStart": 0ï¼"sourceOffsetEnd": 9223372036854775807ï¼"buildType": "BUILD"}' http://localhost:7070/kylin/api/cubes/{your_cube_name}/build2</code></pre></div>
+
+<p>ç°å¨æ¨å¯ä»¥è§ç cube ä» streaming ä¸èªå¨ builtãå½ cube segments 累积å°æ´å¤§çæ¶é´èå´ï¼Kylin å°ä¼èªå¨çå°å
¶å并å°ä¸ä¸ªæ´å¤§ç segment ä¸ã</p>
+
+<h2 id="section-2">çé¾è§£ç</h2>
+
+<ul>
+ <li>è¿è¡ âkylin.shâ æ¶æ¨å¯è½éå°ä»¥ä¸é误:</li>
+</ul>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/clients/producer/Producer
+ at java.lang.Class.getDeclaredMethods0(Native Method)
+ at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
+ at java.lang.Class.getMethod0(Class.java:2856)
+ at java.lang.Class.getMethod(Class.java:1668)
+ at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
+ at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
+Caused by: java.lang.ClassNotFoundException: org.apache.kafka.clients.producer.Producer
+ at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
+ at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
+ at java.security.AccessController.doPrivileged(Native Method)
+ at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
+ at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
+ at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
+ at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
+ ... 6 more</code></pre></div>
+
+<p>åå æ¯ Kylin ä¸è½æ¾å°æ£ç¡®ç Kafka client jarsï¼ç¡®ä¿æ¨è®¾ç½®äºæ£ç¡®ç âKAFKA_HOMEâ ç¯å¢åéã</p>
+
+<ul>
+ <li>âBuild Cubeâ æ¥éª¤ä¸ç âkilled by adminâ é误</li>
+</ul>
+
+<p>å¨ Sandbox VM ä¸ï¼YARN ä¸è½ç» MR job åé
请æ±çå
åèµæºï¼å 为 âinmemâ cubing ç®æ³éè¦æ´å¤çå
åãæ¨å¯ä»¥éè¿è¯·æ±æ´å°çå
åæ¥ç»è¿è¿ä¸æ¥: ç¼è¾ âconf/kylin_job_conf_inmem.xmlâï¼å°è¿ä¸¤ä¸ªåæ°æ¹ä¸ºå¦ä¸è¿æ ·:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff"><property>
+ <name>mapreduce.map.memory.mb</name>
+ <value>1072</value>
+ <description></description>
+ </property>
+
+ <property>
+ <name>mapreduce.map.java.opts</name>
+ <value>-Xmx800m</value>
+ <description></description>
+ </property></code></pre></div>
+
+<ul>
+ <li>å¦æ Kafka éå·²ç»æä¸ç»åå² message ä¸æ¨ä¸æ³ä»æå¼å§ buildï¼æ¨å¯ä»¥è§¦åä¸ä¸ªè°ç¨æ¥å°å½åçç»æä½ç½®è®¾ä¸º cube çå¼å§:</li>
+</ul>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">curl -X PUT --user ADMIN:KYLIN -H "Content-Type: application/json;charset=utf-8" -d '{ "sourceOffsetStart": 0ï¼"sourceOffsetEnd": 9223372036854775807ï¼"buildType": "BUILD"}' http://localhost:7070/kylin/api/cubes/{your_cube_name}/init_start_offsets</code></pre></div>
+
+<ul>
+ <li>å¦æä¸äº build job åºéäºå¹¶ä¸æ¨å°å
¶ discardï¼Cube ä¸å°±ä¼çæä¸ä¸ªæ´ï¼æ称为空éï¼ãæ¯ä¸æ¬¡ Kylin é½ä¼ä»æåçä½ç½® buildï¼æ¨ä¸å¯ææéè¿æ£å¸¸ç builds å°æ´å¡«è¡¥ãKylin æä¾äº API æ£æ¥åå¡«è¡¥æ´</li>
+</ul>
+
+<p>æ£æ¥æ´:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">curl -X GET --user ADMINN:KYLIN -H "Content-Type: application/json;charset=utf-8" http://localhost:7070/kylin/api/cubes/{your_cube_name}/holes</code></pre></div>
+
+<p>å¦ææ¥è¯¢ç»ææ¯ä¸ä¸ªç©ºçæ°ç»ï¼æå³ç没ææ´ï¼å¦åï¼è§¦å Kylin å¡«è¡¥ä»ä»¬:</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">curl -X PUT --user ADMINN:KYLIN -H "Content-Type: application/json;charset=utf-8" http://localhost:7070/kylin/api/cubes/{your_cube_name}/holes</code></pre></div>
+
+
+ </article>
+ </div>
+ </div>
+ </div>
+ <!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<div class="col-md-4 col-lg-4 col-xs-12 col-sm-12 aside1 visible-sm visible-xs visible-md visible-lg" id="nside1" style="margin-top: 5em;float:right;">
+ <ul class="nav nav-pills nav-stacked">
+
+ <li><a href="#titleå¼å§" data-toggle="collapse" class="navtitle">å¼å§</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/index.html" class="list-group-item-lay pjaxlink ">æ¦è¿°</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#titleå®è£
" data-toggle="collapse" class="navtitle">å®è£
</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/index.html" class="list-group-item-lay pjaxlink ">å®è£
æå</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/kylin_cluster.html" class="list-group-item-lay pjaxlink ">Cluster 模å¼ä¸é¨ç½²</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/configuration.html" class="list-group-item-lay pjaxlink ">Kylin é
ç½®</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/advance_settings.html" class="list-group-item-lay pjaxlink ">é«çº§è®¾ç½®</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/kylin_aws_emr.html" class="list-group-item-lay pjaxlink ">å¨ AWS EMR ä¸ å®è£
Kylin</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/install/kylin_docker.html" class="list-group-item-lay pjaxlink ">ç¨ Docker è¿è¡ Kylin</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#titleæç¨" data-toggle="collapse" class="navtitle">æç¨</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/kylin_sample.html" class="list-group-item-lay pjaxlink ">æ ·ä¾ Cube å¿«éå
¥é¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/web.html" class="list-group-item-lay pjaxlink ">Web çé¢</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/create_cube.html" class="list-group-item-lay pjaxlink ">Cube å建</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_build_job.html" class="list-group-item-lay pjaxlink ">Cube æ建å Job çæ§</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/project_level_acl.html" class="list-group-item-lay pjaxlink ">Project Level ACL</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_spark.html" class="list-group-item-lay pjaxlink ">ç¨ Spark æ建 Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_streaming.html" class="list-group-item-lay pjaxlink ">ä» Kafka æµæ建 Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_build_performance.html" class="list-group-item-lay pjaxlink ">ä¼å Cube æ建</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/kylin_client_tool.html" class="list-group-item-lay pjaxlink ">Python 客æ·ç«¯</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/setup_systemcube.html" class="list-group-item-lay pjaxlink ">建ç«ç³»ç» Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/use_cube_planner.html" class="list-group-item-lay pjaxlink ">ä½¿ç¨ Cube Planner</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/use_dashboard.html" class="list-group-item-lay pjaxlink ">ä½¿ç¨ Dashboard</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/setup_jdbc_datasource.html" class="list-group-item-lay pjaxlink ">å»ºç« JDBC æ°æ®æº</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#titleå·¥å
·éæ" data-toggle="collapse" class="navtitle">å·¥å
·éæ</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/odbc.html" class="list-group-item-lay pjaxlink ">ODBC 驱å¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/jdbc.html" class="list-group-item-lay pjaxlink ">JDBC 驱å¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/tableau.html" class="list-group-item-lay pjaxlink ">Tableau 8</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/tableau_91.html" class="list-group-item-lay pjaxlink ">Tableau 9</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/powerbi.html" class="list-group-item-lay pjaxlink ">Excel å Power BI æç¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/squirrel.html" class="list-group-item-lay pjaxlink ">SQuirreL</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/Qlik.html" class="list-group-item-lay pjaxlink ">Qlik Sense éæ</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#title帮å©" data-toggle="collapse" class="navtitle">帮å©</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_use_restapi.html" class="list-group-item-lay pjaxlink ">Use RESTful API</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_build_cube_with_restapi.html" class="list-group-item-lay pjaxlink ">ç¨ API æ建 Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_optimize_cubes.html" class="list-group-item-lay pjaxlink ">ä¼å Cube 设计</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_optimize_build.html" class="list-group-item-lay pjaxlink ">ä¼å Cube æ建</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_backup_metadata.html" class="list-group-item-lay pjaxlink ">å¤ä»½å
æ°æ®</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_cleanup_storage.html" class="list-group-item-lay pjaxlink ">æ¸
çåå¨</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+
+ </ul>
+</div>
+ </div>
+ </div>
+ <!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+<footer id="underfooter">
+ <div>
+ <div class="row">
+ <div class="col-md-12 widget">
+ <div class="widget-body">
+ <div class="footer-img">
+ <a href="http://www.apache.org">
+ <img id="asf-logo" height="78px" alt="Apache Software Foundation" src="/assets/images/apache_footer.png">
+ </a>
+ </div>
+ <p style="padding-top: 11px;">
+ The contents of this website are © 2015 Apache Software Foundation under the terms of the
+ <a href="http://www.apache.org/licenses/LICENSE-2.0"> Apache License v2 </a>.
+ </p>
+ <p style="margin-bottom: 11px;">
+ Apache Kylin and its logo are trademarks of the Apache Software Foundation.
+ </div>
+
+ </div>
+ </div>
+ </div>
+ <!-- /row of widgets -->
+
+ </div>
+ <div></div>
+
+</footer>
+
+ <script src="/assets/js/jquery-1.9.1.min.js"></script>
+ <script src="/assets/js/bootstrap.min.js"></script>
+ <script src="/assets/js/main.js"></script>
+ </body>
+</html>
Modified: kylin/site/cn/docs23/tutorial/jdbc.html
URL: http://svn.apache.org/viewvc/kylin/site/cn/docs23/tutorial/jdbc.html?rev=1834820&r1=1834819&r2=1834820&view=diff
==============================================================================
--- kylin/site/cn/docs23/tutorial/jdbc.html (original)
+++ kylin/site/cn/docs23/tutorial/jdbc.html Mon Jul 2 06:08:48 2018
@@ -41,7 +41,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Apache Kylin | Kylin JDBC Driver</title>
+ <title>Apache Kylin | JDBC 驱å¨</title>
<meta name="description" content="Apache Kylin Home">
<meta name="author" content="Apache Kylin">
<link rel="shortcut icon" href="fav.png" type="image/png">
@@ -160,7 +160,104 @@ var _hmt = _hmt || [];
<div class="container">
- <div class="row">
+ <div class="row" style="clear:both;">
+ <div class="col-md-8 col-lg-8 col-xs-12 col-sm-12 aside2" style="float:right;">
+ <div id="container" class="docs">
+ <div id="pjax">
+ <h1 class="post-title">JDBC 驱å¨</h1>
+ <article class="post-content" >
+ <h3 id="section">认è¯</h3>
+
+<h6 id="apache-kylinrestful">åºäºApache Kylin认è¯RESTFULæå¡ãæ¯æçåæ°ï¼</h6>
+<ul>
+ <li>user : ç¨æ·å</li>
+ <li>password : å¯ç </li>
+ <li>ssl: trueæfalseã é»è®¤ä¸ºflasï¼å¦æ为trueï¼ææçæå¡è°ç¨é½ä¼ä½¿ç¨httpsã</li>
+</ul>
+
+<h3 id="url">è¿æ¥urlæ ¼å¼ï¼</h3>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">jdbc:kylin://<hostname>:<port>/<kylin_project_name></code></pre></div>
+
+<ul>
+ <li>å¦æâsslâ为trueï¼âportâåºè¯¥æ¯Kylin serverçHTTPS端å£ã</li>
+ <li>å¦æâportâæªè¢«æå®ï¼driverä¼ä½¿ç¨é»è®¤ç端å£ï¼HTTP 80ï¼HTTPS 443ã</li>
+ <li>å¿
é¡»æå®âkylin_project_nameâ并ä¸ç¨æ·éè¦ç¡®ä¿å®å¨Kylin serverä¸åå¨ã</li>
+</ul>
+
+<h3 id="statement">1. 使ç¨Statementæ¥è¯¢</h3>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
+
+Properties info = new Properties();
+info.put("user", "ADMIN");
+info.put("password", "KYLIN");
+Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
+Statement state = conn.createStatement();
+ResultSet resultSet = state.executeQuery("select * from test_table");
+
+while (resultSet.next()) {
+ assertEquals("foo", resultSet.getString(1));
+ assertEquals("bar", resultSet.getString(2));
+ assertEquals("tool", resultSet.getString(3));
+}</code></pre></div>
+
+<h3 id="preparedstatementv">2. 使ç¨PreparedStatementvæ¥è¯¢</h3>
+
+<h6 id="preparedstatement">æ¯æçPreparedStatementåæ°ï¼</h6>
+<ul>
+ <li>setString</li>
+ <li>setInt</li>
+ <li>setShort</li>
+ <li>setLong</li>
+ <li>setFloat</li>
+ <li>setDouble</li>
+ <li>setBoolean</li>
+ <li>setByte</li>
+ <li>setDate</li>
+ <li>setTime</li>
+ <li>setTimestamp</li>
+</ul>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
+Properties info = new Properties();
+info.put("user", "ADMIN");
+info.put("password", "KYLIN");
+Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
+PreparedStatement state = conn.prepareStatement("select * from test_table where id=?");
+state.setInt(1, 10);
+ResultSet resultSet = state.executeQuery();
+
+while (resultSet.next()) {
+ assertEquals("foo", resultSet.getString(1));
+ assertEquals("bar", resultSet.getString(2));
+ assertEquals("tool", resultSet.getString(3));
+}</code></pre></div>
+
+<h3 id="section-1">3. è·åæ¥è¯¢ç»æå
æ°æ®</h3>
+<p>Kylin jdbc driveræ¯æå
æ°æ®å表æ¹æ³ï¼<br />
+éè¿sql模å¼è¿æ»¤å¨ï¼æ¯å¦ %ï¼ååºcatalogãschemaãtableåcolumnã</p>
+
+<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
+Properties info = new Properties();
+info.put("user", "ADMIN");
+info.put("password", "KYLIN");
+Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
+Statement state = conn.createStatement();
+ResultSet resultSet = state.executeQuery("select * from test_table");
+
+ResultSet tables = conn.getMetaData().getTables(null, null, "dummy", null);
+while (tables.next()) {
+ for (int i = 0; i < 10; i++) {
+ assertEquals("dummy", tables.getString(i + 1));
+ }
+}</code></pre></div>
+
+
+ </article>
+ </div>
+ </div>
+ </div>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -252,6 +349,10 @@ var _hmt = _hmt || [];
+
+
+
+
<li class="navlist">
<a href="/cn/docs23/index.html" class="list-group-item-lay pjaxlink ">æ¦è¿°</a>
</li>
@@ -355,33 +456,13 @@ var _hmt = _hmt || [];
-
-
<li class="navlist">
- <a href="/cn/docs23/install/manual_install_guide.html" class="list-group-item-lay pjaxlink ">æå¨å®è£
æå</a>
+ <a href="/cn/docs23/install/index.html" class="list-group-item-lay pjaxlink ">å®è£
æå</a>
</li>
-
-
-
-
- <ul>
- </div>
-</div>
-
- <li><a href="#titleæç¨" data-toggle="collapse" class="navtitle">æç¨</a></li>
- <div class="collapse in">
- <div class="list-group" id="list1">
- <ul>
-
-
-
-
-
-
@@ -468,14 +549,8 @@ var _hmt = _hmt || [];
-
-
-
-
-
-
<li class="navlist">
- <a href="/cn/docs23/tutorial/create_cube.html" class="list-group-item-lay pjaxlink ">Cube å建</a>
+ <a href="/cn/docs23/install/kylin_cluster.html" class="list-group-item-lay pjaxlink ">Cluster 模å¼ä¸é¨ç½²</a>
</li>
@@ -553,32 +628,8 @@ var _hmt = _hmt || [];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
<li class="navlist">
- <a href="/cn/docs23/tutorial/cube_build_job.html" class="list-group-item-lay pjaxlink ">Cube æ建å Job çæ§</a>
+ <a href="/cn/docs23/install/configuration.html" class="list-group-item-lay pjaxlink ">Kylin é
ç½®</a>
</li>
@@ -652,22 +703,21 @@ var _hmt = _hmt || [];
+ <li class="navlist">
+ <a href="/cn/docs23/install/advance_settings.html" class="list-group-item-lay pjaxlink ">é«çº§è®¾ç½®</a>
+ </li>
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
@@ -742,7 +792,10 @@ var _hmt = _hmt || [];
-
+ <li class="navlist">
+ <a href="/cn/docs23/install/kylin_aws_emr.html" class="list-group-item-lay pjaxlink ">å¨ AWS EMR ä¸ å®è£
Kylin</a>
+ </li>
+
@@ -836,11 +889,40 @@ var _hmt = _hmt || [];
-
+ <li class="navlist">
+ <a href="/cn/docs23/install/kylin_docker.html" class="list-group-item-lay pjaxlink ">ç¨ Docker è¿è¡ Kylin</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#titleæç¨" data-toggle="collapse" class="navtitle">æç¨</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
@@ -902,21 +984,12 @@ var _hmt = _hmt || [];
- <li class="navlist">
- <a href="/cn/docs23/tutorial/web.html" class="list-group-item-lay pjaxlink ">Web çé¢</a>
- </li>
-
-
-
-
-
+
-
-
-
+
@@ -979,9 +1052,22 @@ var _hmt = _hmt || [];
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/kylin_sample.html" class="list-group-item-lay pjaxlink ">æ ·ä¾ Cube å¿«éå
¥é¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
@@ -1023,21 +1109,12 @@ var _hmt = _hmt || [];
- <li class="navlist">
- <a href="/cn/docs23/tutorial/kylin_client_tool.html" class="list-group-item-lay pjaxlink ">Python 客æ·ç«¯å·¥å
ጼ</a>
- </li>
-
-
-
-
-
+
-
-
-
+
@@ -1175,7 +1252,7 @@ var _hmt = _hmt || [];
<li class="navlist">
- <a href="/cn/docs23/tutorial/tableau.html" class="list-group-item-lay pjaxlink ">Tableau</a>
+ <a href="/cn/docs23/tutorial/web.html" class="list-group-item-lay pjaxlink ">Web çé¢</a>
</li>
@@ -1287,10 +1364,2392 @@ var _hmt = _hmt || [];
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/create_cube.html" class="list-group-item-lay pjaxlink ">Cube å建</a>
+ </li>
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_build_job.html" class="list-group-item-lay pjaxlink ">Cube æ建å Job çæ§</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/project_level_acl.html" class="list-group-item-lay pjaxlink ">Project Level ACL</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_spark.html" class="list-group-item-lay pjaxlink ">ç¨ Spark æ建 Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_streaming.html" class="list-group-item-lay pjaxlink ">ä» Kafka æµæ建 Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/cube_build_performance.html" class="list-group-item-lay pjaxlink ">ä¼å Cube æ建</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/kylin_client_tool.html" class="list-group-item-lay pjaxlink ">Python 客æ·ç«¯</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/setup_systemcube.html" class="list-group-item-lay pjaxlink ">建ç«ç³»ç» Cube</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/use_cube_planner.html" class="list-group-item-lay pjaxlink ">ä½¿ç¨ Cube Planner</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/use_dashboard.html" class="list-group-item-lay pjaxlink ">ä½¿ç¨ Dashboard</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/setup_jdbc_datasource.html" class="list-group-item-lay pjaxlink ">å»ºç« JDBC æ°æ®æº</a>
+ </li>
+
+
+
+
+
+
+
+
+ <ul>
+ </div>
+</div>
+
+ <li><a href="#titleå·¥å
·éæ" data-toggle="collapse" class="navtitle">å·¥å
·éæ</a></li>
+ <div class="collapse in">
+ <div class="list-group" id="list1">
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/odbc.html" class="list-group-item-lay pjaxlink ">ODBC 驱å¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/jdbc.html" class="list-group-item-lay pjaxlink ">JDBC 驱å¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/tableau.html" class="list-group-item-lay pjaxlink ">Tableau 8</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/tableau_91.html" class="list-group-item-lay pjaxlink ">Tableau 9</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="navlist">
+ <a href="/cn/docs23/tutorial/powerbi.html" class="list-group-item-lay pjaxlink ">Excel å Power BI æç¨</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1329,21 +3788,12 @@ var _hmt = _hmt || [];
- <li class="navlist">
- <a href="/cn/docs23/tutorial/tableau_91.html" class="list-group-item-lay pjaxlink ">Tableau 9</a>
- </li>
-
-
-
-
-
+
-
-
-
+
@@ -1462,10 +3912,7 @@ var _hmt = _hmt || [];
- <li class="navlist">
- <a href="/cn/docs23/tutorial/powerbi.html" class="list-group-item-lay pjaxlink ">MS ExcelåPower BIæç¨</a>
- </li>
-
+
@@ -1591,8 +4038,58 @@ var _hmt = _hmt || [];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<li class="navlist">
- <a href="/cn/docs23/tutorial/odbc.html" class="list-group-item-lay pjaxlink ">ODBC 驱å¨ç¨åº</a>
+ <a href="/cn/docs23/tutorial/squirrel.html" class="list-group-item-lay pjaxlink ">SQuirreL</a>
</li>
@@ -1682,6 +4179,20 @@ var _hmt = _hmt || [];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<li class="navlist">
<a href="/cn/docs23/tutorial/Qlik.html" class="list-group-item-lay pjaxlink ">Qlik Sense éæ</a>
</li>
@@ -1727,8 +4238,46 @@ var _hmt = _hmt || [];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<li class="navlist">
- <a href="/cn/docs23/howto/howto_backup_metadata.html" class="list-group-item-lay pjaxlink ">å¤ä»½å
æ°æ®</a>
+ <a href="/cn/docs23/howto/howto_use_restapi.html" class="list-group-item-lay pjaxlink ">Use RESTful API</a>
</li>
@@ -1793,8 +4342,26 @@ var _hmt = _hmt || [];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<li class="navlist">
- <a href="/cn/docs23/howto/howto_cleanup_storage.html" class="list-group-item-lay pjaxlink ">æ¸
çåå¨</a>
+ <a href="/cn/docs23/howto/howto_optimize_cubes.html" class="list-group-item-lay pjaxlink ">ä¼å Cube 设计</a>
</li>
@@ -1836,8 +4403,14 @@ var _hmt = _hmt || [];
+
+
+
+
+
+
<li class="navlist">
- <a href="/cn/docs23/howto/howto_jdbc.html" class="list-group-item-lay pjaxlink ">Kylin JDBC Driver</a>
+ <a href="/cn/docs23/howto/howto_optimize_build.html" class="list-group-item-lay pjaxlink ">ä¼å Cube æ建</a>
</li>
@@ -1863,9 +4436,22 @@ var _hmt = _hmt || [];
+ <li class="navlist">
+ <a href="/cn/docs23/howto/howto_backup_metadata.html" class="list-group-item-lay pjaxlink ">å¤ä»½å
æ°æ®</a>
+ </li>
+
+
+
+
+
+
+
+
+
+
@@ -1886,7 +4472,7 @@ var _hmt = _hmt || [];
<li class="navlist">
- <a href="/cn/docs23/howto/howto_optimize_build.html" class="list-group-item-lay pjaxlink ">ä¼å Cube æ建</a>
+ <a href="/cn/docs23/howto/howto_cleanup_storage.html" class="list-group-item-lay pjaxlink ">æ¸
çåå¨</a>
</li>
@@ -1903,103 +4489,6 @@ var _hmt = _hmt || [];
</ul>
</div>
- <div class="col-md-8 col-lg-8 col-xs-12 col-sm-12 aside2">
- <div id="container" class="docs">
- <div id="pjax">
- <h1 class="post-title">Kylin JDBC Driver</h1>
- <article class="post-content" >
- <h3 id="section">认è¯</h3>
-
-<h6 id="apache-kylinrestful">åºäºApache Kylin认è¯RESTFULæå¡ãæ¯æçåæ°ï¼</h6>
-<ul>
- <li>user : ç¨æ·å</li>
- <li>password : å¯ç </li>
- <li>ssl: trueæfalseã é»è®¤ä¸ºflasï¼å¦æ为trueï¼ææçæå¡è°ç¨é½ä¼ä½¿ç¨httpsã</li>
-</ul>
-
-<h3 id="url">è¿æ¥urlæ ¼å¼ï¼</h3>
-
-<div class="highlight"><pre><code class="language-groff" data-lang="groff">jdbc:kylin://<hostname>:<port>/<kylin_project_name></code></pre></div>
-
-<ul>
- <li>å¦æâsslâ为trueï¼âportâåºè¯¥æ¯Kylin serverçHTTPS端å£ã</li>
- <li>å¦æâportâæªè¢«æå®ï¼driverä¼ä½¿ç¨é»è®¤ç端å£ï¼HTTP 80ï¼HTTPS 443ã</li>
- <li>å¿
é¡»æå®âkylin_project_nameâ并ä¸ç¨æ·éè¦ç¡®ä¿å®å¨Kylin serverä¸åå¨ã</li>
-</ul>
-
-<h3 id="statement">1. 使ç¨Statementæ¥è¯¢</h3>
-
-<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
-
-Properties info = new Properties();
-info.put("user", "ADMIN");
-info.put("password", "KYLIN");
-Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
-Statement state = conn.createStatement();
-ResultSet resultSet = state.executeQuery("select * from test_table");
-
-while (resultSet.next()) {
- assertEquals("foo", resultSet.getString(1));
- assertEquals("bar", resultSet.getString(2));
- assertEquals("tool", resultSet.getString(3));
-}</code></pre></div>
-
-<h3 id="preparedstatementv">2. 使ç¨PreparedStatementvæ¥è¯¢</h3>
-
-<h6 id="preparedstatement">æ¯æçPreparedStatementåæ°ï¼</h6>
-<ul>
- <li>setString</li>
- <li>setInt</li>
- <li>setShort</li>
- <li>setLong</li>
- <li>setFloat</li>
- <li>setDouble</li>
- <li>setBoolean</li>
- <li>setByte</li>
- <li>setDate</li>
- <li>setTime</li>
- <li>setTimestamp</li>
-</ul>
-
-<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
-Properties info = new Properties();
-info.put("user", "ADMIN");
-info.put("password", "KYLIN");
-Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
-PreparedStatement state = conn.prepareStatement("select * from test_table where id=?");
-state.setInt(1, 10);
-ResultSet resultSet = state.executeQuery();
-
-while (resultSet.next()) {
- assertEquals("foo", resultSet.getString(1));
- assertEquals("bar", resultSet.getString(2));
- assertEquals("tool", resultSet.getString(3));
-}</code></pre></div>
-
-<h3 id="section-1">3. è·åæ¥è¯¢ç»æå
æ°æ®</h3>
-<p>Kylin jdbc driveræ¯æå
æ°æ®å表æ¹æ³ï¼<br />
-éè¿sql模å¼è¿æ»¤å¨ï¼æ¯å¦ %ï¼ååºcatalogãschemaãtableåcolumnã</p>
-
-<div class="highlight"><pre><code class="language-groff" data-lang="groff">Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
-Properties info = new Properties();
-info.put("user", "ADMIN");
-info.put("password", "KYLIN");
-Connection conn = driver.connect("jdbc:kylin://localhost:7070/kylin_project_name", info);
-Statement state = conn.createStatement();
-ResultSet resultSet = state.executeQuery("select * from test_table");
-
-ResultSet tables = conn.getMetaData().getTables(null, null, "dummy", null);
-while (tables.next()) {
- for (int i = 0; i < 10; i++) {
- assertEquals("dummy", tables.getString(i + 1));
- }
-}</code></pre></div>
-
-
- </article>
- </div>
- </div>
- </div>
</div>
</div>
<!--