每日总结
今天进行的是hive数据库的增删改查
要进行数据库的更新操作需要进行一定的配置文件的修改。
配置hive-site.xml
<property> <name>hive.support.concurrency</name> <value>true</value> </property> <property> <name>hive.exec.dynamic.partition.mode</name> <value>nonstrict</value> </property> <property> <name>hive.txn.manager</name> <value>org.apache.hadoop.hive.ql.lockmgr.DbTxnManager</value> </property> <property> <name>hive.compactor.initiator.on</name> <value>true</value> </property> <property> <name>hive.compactor.worker.threads</name> <value>1</value> </property>
建表何操作语句:
CREATE TABLE test1 (dt string, user_id STRING,search_word string,url STRING) CLUSTERED BY (user_id) INTO 8 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional'='true');按照一定的格式建表 INSERT INTO TABLE test1 SELECT * FROM test_load;加载之前的数据 select * from test1; delete from test1 where user_id = 312;