<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] # 配置 關系型數據庫中,對分區表insert數據時候,數據庫自動會根據分區字段的值,將數據插入到相應的分區中,hive中也提供了類似的機制,即動態分區(Dynamic Partition),只不過,使用hive的動態分區,需要進行相應的配置 開啟動態分區參數設置 * 開啟動態分區功能(默認true,開啟) ~~~ hive.exec.dynamic.partition=true ~~~ * 設置為非嚴格模式(動態分區的模式,默認strict,表示必須指定至少一個分區為靜態分區, nonstrict模式表示允許所有的分區字段都可以使用動態分區) ~~~ hive.exec.dynamic.partition.mode=nonstrict ~~~ * **在所有執行MR的節點上**,最大一個節點可以創建多少個動態分區 ~~~ hive.exec.max.dynamic.partitions=1000 ~~~ * **在每個執行MR的節點上**,最大可以創建多少動態分區.該參數需要根據實際的數據來設定.比如:源數據中包含了一年的數據,即day字段有365個值,那么該參數就需要設置成大于365,如果使用默認值100,則會報錯 ~~~ hive.exec.max.dynamic.partitions.pernode=100 ~~~ * 整個MR Job中,最大可以創建多少個HDFS文件 ~~~ hive.exec.max.created.files=100000 ~~~ * 當有空分區生成時,是否拋出異常.一般不需要設置 ~~~ hive.error.on.empty.partition=false ~~~ # 案例 將ori中的數據按照時間(如:2011123000008),插入到目標表`ori_partitioned_target`的相應分區中 1. 創建分區表 ~~~ create table ori_partitioned(id bigint, time bigint, uid string, keyword string, url_rank int, click_num int, click_url string) partitioned by (p_time bigint) row format delimited fields terminated by '\t'; ~~~ 2. 加載數據到分區表中 ~~~ hive> load data local inpath '/root/ds1' into table ori_partititoned partition(p_time='2011123000008'); hive> load data local inpath '/root/ds2' into table ori_partititoned partition(p_time='2011123000011'); ~~~ 3. 創建目標分區表 ~~~ create table ori_partitioned_target(id bigint, time bigint, uid string, keyword string, url_rank int, click_num int, click_url string) partitioned by(p_time string) row format delimited fields terminated by '\t'; ~~~ 4. 設置動態分區 ~~~ set hive.exec.dynamic.partition=true; set hive.exec.dynamic.partition.mode=nonstrict; set hive.exec.max.dynamic.partitions=1000; set hive.exec.max.dynamic.partitions.pernode=100; set hive.exec.max.created.files=100000; hive> insert overwrite table ori_partitioned_target partition(p_time) select id,time, uid,keyword, url_rank, click_num, click_url, p_time from ori_partitioned; ~~~ 5. 查看目標分區表的分區情況 ~~~ hive> show partitions ori_partitioned_target; ~~~
                  <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>

                              哎呀哎呀视频在线观看