<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                **1. `load`方式導入** 語法: ```sql load data [local] inpath '/opt/datas/student.txt' [overwrite] into table student [partition (partcol1=val1,…)]; ``` 示例: ```sql #### 將本地 dept.txt 數據裝載到 dept 表中,這是復制行為 #### load data local inpath "/hdatas/dept.txt" into table dept; #### 在hive上移動數據 #### -- hdfs中的dept.txt數據移動到dept_2表后,dept.txt中的數據就沒有了,但文件還在,是個空文件 load data inpath '/home/hadoop/hive/warehouse/hivedb.db/dept/dept.txt' into table dept_2; #### 裝載數據并覆蓋原有數據 #### load data local inpath '/hdatas/dept.txt' overwrite into table dept; #### 裝載數據到分區中 #### load data local inpath '/hdatas/dept.txt' into table dept partition(dt="2020-01-02"); ``` <br/> **2. `insert`方式導入** 語法: ```sql -- 當為into table時,table可以省略,但是overwrite table 不能省略table insert overwrite|into table tablename(col_list) [partition (partcol1=val1, partcol2=val2, ...)] values(col_list); | select fileds,... from tb_other; ``` 示例: ```sql (0)insert不支持的寫法 insert overwrite table test select 'hello'; (1)插入值列表插入 insert into table student partition(month='201709') values ('1004','zhaoliu'), ('1005','zhangsan'); (2)基本模式插入(根據單張表查詢結果) -- 插入到靜態分區中 insert overwrite table student partition(month='201708') select id, name from student where month='201709'; (3)多插入模式(根據多張表查詢結果) -- 高性能:只需掃描一次輸入數據 from student insert overwrite table student partition(month='201707') select id, name where month='201709' insert overwrite table student partition(month='201706') select id, name where month='201709'; (4)插入到動態分區(需要開啟動態分區) -- 典型的etl模式 from ctas_employee insert overwrite table employee_partitioned partition(year, month) select *,2018,09; (5)通過指定值插入(hive1.2版本以后支持) insert into employee(name) select 'john' from test limit 1; (6)通過指定列插入(hive1.2版本以后支持) insert into employee(name) values('judy'),('john'); ``` <br/> **3. `as select`方式導入** ```sql create table if not exists student3 as select id, name from student; ``` <br/> **4. 通過hdfs上傳** ```sql -- 創建表,并指定在 hdfs 上的位置 hive (default)> create table if not exists student5( id int, name string) row format delimited fields terminated by '\t' location '/kgc/hive/student5'; -- 上傳數據到 hdfs 上 hive (default)> dfs -put /opt/datas/student.txt /kgc/hive/student5; ``` <br/> **5. import方式** ```sql -- 將Hive的student目錄下的數據導入到student2表中 import table student2 partition(month='201709') from '/user/hive/warehouse/export/student'; ```
                  <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>

                              哎呀哎呀视频在线观看