<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Lens 解釋器 原文鏈接 : [http://zeppelin.apache.org/docs/0.7.2/interpreter/lens.html](http://zeppelin.apache.org/docs/0.7.2/interpreter/lens.html) 譯文鏈接 : [http://www.apache.wiki/pages/viewpage.action?pageId=10030852](http://www.apache.wiki/pages/viewpage.action?pageId=10030852) 貢獻者 : [片刻](/display/~jiangzhonglian) [ApacheCN](/display/~apachecn) [Apache中文網](/display/~apachechina) ## 概觀 [Apache Lens](https://lens.apache.org/)提供統一分析界面。Lens旨在通過跨多個分層數據存儲提供單一數據視圖并為分析查詢提供最佳執行環境,從而減少數據分析孤立。它將Hadoop與傳統的數據倉庫無縫集成在一起的工具之一。 ![](https://img.kancloud.cn/7e/3e/7e3eb8d1dd66729adcbc08676e11d07d_566x325.jpg) ## 安裝和運行Lens 為了使用Lens解釋器,您可以通過以下簡單的步驟安裝Apache Lens: 1. 從[ASF](http://www.apache.org/dyn/closer.lua/lens/2.3-beta)下載Lens的最新版本。或者舊版本可以[在檔案館](http://archive.apache.org/dist/lens/)找到。 2. 在運行鏡頭之前,您必須設置HIVE?_HOME和HADOOP_?HOME。如果你想獲得更多的信息,請參考[這里](http://lens.apache.org/lenshome/install-and-run.html#Installation)。鏡頭還提供偽分布模式。[Lens偽分布式設置](http://lens.apache.org/lenshome/pseudo-distributed-setup.html)是通過使用[docker](https://www.docker.com/)處理器完成的。Hive服務器和hadoop守護程序作為鏡頭偽分布式設置中的單獨進程運行。 3. 現在,您可以啟動鏡頭服務器(或停止)。 ``` ./bin/lens-ctl start (or stop)? ``` ## 配置Lens解釋器 在“解釋器”菜單中,您可以編輯Lens解釋器或創建新的Lens解釋器。Zeppelin提供Lens的這些屬性。 | 物業名稱 | 值 | 描述 | | --- | --- | --- | | lens.client.dbname | default | 數據庫模式名稱 | | lens.query.enable.persistent.resultset | false | 是否為查詢啟用持久性結果集。啟用后,服務器將從驅動程序中獲取結果,如果有的話將自定義格式,并存儲在配置的位置。查詢輸出的文件名是queryhandle-id,帶有已配置的擴展名 | | lens.server.base.url | http://hostname:port/lensapi | Lens服務器的基本URL。你必須編輯你可能使用的“hostname”和“port”(例如: http://0.0.0.0:9999/lensapi) | | lens.session.cluster.user | default | Hadoop集群用戶名 | | zeppelin.lens.maxResult | 1000 | 要顯示的最大行數 | | zeppelin.lens.maxThreads | 10 | 如果并發是真的,那么有多少個線程? | | zeppelin.lens.run.concurrent | true | 同時執行Lens會話 | | XXX | YYY | [配置Lens服務器]()中的其他任何內容 | ![](https://img.kancloud.cn/a6/71/a671224c97c79491f7a239fe68adcafb_566x267.jpg) ### 解釋器綁定為Zeppelin筆記本 配置Lens解釋器后,創建自己的筆記本,然后您可以綁定如下圖像的解釋器。 ![](https://img.kancloud.cn/77/85/77854a42aeb0f7e514686ec4948d9108_566x217.jpg) 有關更多的解釋器綁定信息,請參閱[此處](http://zeppelin.apache.org/docs/manual/interpreters.html)。 ### 如何使用 您可以使用[OLAP Cube?](http://lens.apache.org/user/olap-cube.html)[QL](http://lens.apache.org/user/cli.html)來分析數據,這是一種高級SQL類似語言來查詢和描述以數據立方體組織的數據集。您可能會遇到OLAP立方體像這個[視頻教程](https://cwiki.apache.org/confluence/display/LENS/2015/07/13/20+Minute+video+demo+of+Apache+Lens+through+examples)。您可以在此視頻中看到,它們使用的是鏡頭客戶機外殼(./ bin / lens-cli.sh)。所有這些功能也可以使用鏡頭解釋器在Zeppelin上使用。 * 創建和使用(切換)數據庫。 ``` create database newDb use newDb ``` * 創建存儲。 ``` create storage your/path/to/lens/client/examples/resources/db-storage.xml? ``` * 創建尺寸,顯示它們的字段和連接鏈。 ``` create dimension your/path/to/lens/client/examples/resources/customer.xml dimension show fields customer dimension show joinchains customer? ``` * 創建緩存,顯示它們的字段和連接鏈。 ``` create cube your/path/to/lens/client/examples/resources/sales-cube.xml cube show fields sales cube show joinchains sales ``` * 創造Dimtables和事實。 ``` create dimtable your/path/to/lens/client/examples/resources/customer_table.xml create fact your/path/to/lens/client/examples/resources/sales-raw-fact.xml ``` * 添加分區到Dimtable和Fact。 ``` dimtable add single-partition --dimtable_name customer_table --storage_name local --path your/path/to/lens/client/examples/resources/customer-local-part.xml fact add partitions --fact_name sales_raw_fact --storage_name local --path your/path/to/lens/client/examples/resources/sales-raw-local-parts.xml ``` * 現在,您可以對多維數據集運行查詢。 ``` query execute cube select customer_city_name, product_details.description, product_details.category, product_details.color, store_sales from sales where time_range_in(delivery_time, '2015-04-11-00', '2015-04-13-00') ``` ![](https://img.kancloud.cn/86/9d/869d3646a31262d1a407951162624415_566x169.jpg) 這些只是Lens提前提供的例子。如果您想探索Lens的整個[教程](https://cwiki.apache.org/confluence/display/LENS/2015/07/13/20+Minute+video+demo+of+Apache+Lens+through+examples),請參閱[教程視頻](https://cwiki.apache.org/confluence/display/LENS/2015/07/13/20+Minute+video+demo+of+Apache+Lens+through+examples)。 ## Lens UI服務 Lens還提供Web UI服務。一旦服務器啟動,您可以打開http://serverhost:19999/index.html上的服務并瀏覽。您也可以在這里檢查您所制作的結構并使用查詢。 ![](https://img.kancloud.cn/9a/6b/9a6b4efaa7de17c93cd56604bdbe6449_566x323.jpg)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看