OKhwz2Time taken: 0.419 secondshive> load data local inpath 'demo.txt' overwrite into table hwz2;Copying data from file:/home/hadoop/demo.txtCopying file: file:/home/hadoop/demo.txtLoading data to table dw2.hwz2Deleted hdfs://master:9000/user/hive/warehouse/dw2.db/hwz2OKTime taken: 0.557 secondshive> select * from hwz2;OK12 jack12 jack12 jack12 jack12 jack12 jack12 jack12 jack$ hadoop dfs -lsr /user/hiveWarning: $HADOOP_HOME is deprecated.drwxr-xr-x - hadoop supergroup 0 2012-03-22 15:36 /user/hive/warehousedrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:48 /user/hive/warehouse/dw2.dbdrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:48 /user/hive/warehouse/dw2.db/hwz2-rw-r--r-- 2 hadoop supergroup 1201 2012-03-22 15:48 /user/hive/warehouse/dw2.db/hwz2/demo.txtdrwxr-xr-x - hadoop supergroup 0 2012-03-22 12:36 /user/hive/warehouse/hwzdrwxr-xr-x - hadoop supergroup 0 2012-03-22 15:36 /user/hive/warehouse/hwz2-rw-r--r-- 2 hadoop supergroup 1201 2012-03-22 15:36 /user/hive/warehouse/hwz2/demo.txt$ hadoop dfs -cat /user/hive/warehouse/dw2.db/hwz2/demo.txt |headWarning: $HADOOP_HOME is deprecated.12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jack12,jackd. 在mysql中验证建立的新表mysql> use hive;Database changedmysql> show tables;+-----------------+| Tables_in_hive |+-----------------+| BUCKETING_COLS || CDS || COLUMNS_V2 || DATABASE_PARAMS || DBS || PARTITION_KEYS || SDS || SD_PARAMS || SEQUENCE_TABLE || SERDES || SERDE_PARAMS || SORT_COLS || TABLE_PARAMS || TBLS |+-----------------+14 rows in set (0.00 sec)9. 常见错误error 1:-------------------------------------------------hive> show tables;FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Error creating transactional connection factorySolution:Hive不带mysql JDBC驱动,自己安装:wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.18.tar.gz/from/http://mysql.mirror.kangaroot.net/tar zxf mysql-connector-java-5.1.18.tar.gzcd mysql-connector-java-5.1.18cp mysql-connector*.jar $HIVE_HOME/liberror 2:-------------------------------------------------hive> show tables;FAILED: Error in metadata: javax.jdo.JDOException: Couldnt obtain a new sequence (unique id) : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.Solution:在mysql中设置 binlog_format='MIXED'
配置hive与mysql_Hive安装配置及与mysql结合应用
最新推荐文章于 2024-03-02 11:02:01 发布