kalor

导航

 

2013年4月6日

摘要: Exception: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)问题描述如下:landen@landen-Lenovo:~$ su root;密码: root@landen-Lenovo:/home/landen# mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)原因:mysql数据库的 阅读全文
posted @ 2013-04-06 15:58 kalor 阅读(1730) 评论(0) 推荐(0) 编辑
 

2013年4月2日

摘要: 参考:http://blog.csdn.net/qiaochao911/article/details/8613988http://xm-king.iteye.com/blog/1088422HIVE分区,实际上是通过一个路径来标识的,而不是在物理数据中。比如每天的数据,可能分区是pt=20121023这样,那么路径中它就会变成:/hdfs/path/pt=20121023/data_files。通过路径来标识的好处是,如果我们需要取特定分区的数据,只需要把这个路径下的数据取出来就可以了,不用扫描全部的数据。HIVE默认是静态分区。但是有时候可能需要动态创建不同的分区,比如商品信息,我想根据它 阅读全文
posted @ 2013-04-02 20:11 kalor 阅读(898) 评论(0) 推荐(0) 编辑
 

2013年4月1日

摘要: Sqoop用户指南:http://archive.cloudera.com/cdh/3/sqoop/SqoopUserGuide.html数据驱动销售:http://www.programmer.com.cn/7614/http://arnetminer.org/structural-hole#b2297https://cwiki.apache.org/Hive/tutorial.htmlhttp://yangshangchuan.iteye.com/blog/1837935http://blog.csdn.net/huhui_bj/article/details/8596388http:// 阅读全文
posted @ 2013-04-01 09:38 kalor 阅读(142) 评论(0) 推荐(0) 编辑
 

2013年3月29日

摘要: hive (student)> show tables;OKcoursestudent_testTime taken: 0.056 secondshive (student)> select * from course;OK1 ["English","Chinese","French","Japanese"]2 ["Chinese","French"]3 ["Chinese","French","Japanese& 阅读全文
posted @ 2013-03-29 22:25 kalor 阅读(1917) 评论(0) 推荐(0) 编辑
 
摘要: JSON表示法:employee_Kelvin = { "name": "John Doe", "salary": 100000.0, "subordinates": ["Mary Smith", "Todd Jones"], "deductions": { "Federal Taxes": .2, "State Taxes": .05, "Insurance": .1 }, "addr 阅读全文
posted @ 2013-03-29 19:47 kalor 阅读(449) 评论(0) 推荐(0) 编辑
 
摘要: hive (student)> create table if not exists course( > stu_num string comment 'the number of a student', > choose_course array<string> comment 'the choosing course of a student') > row format delimited > fields terminated by ':' > collec... 阅读全文
posted @ 2013-03-29 16:56 kalor 阅读(2652) 评论(0) 推荐(0) 编辑
 
摘要: hive (student_test)> use student;OKTime taken: 0.015 secondshive (student)> create table if not exists student_test( > id int comment 'the number of a student', > basic_info struct<name:string,age:int> comment 'the basic information of a student') > row format .. 阅读全文
posted @ 2013-03-29 15:46 kalor 阅读(7377) 评论(0) 推荐(0) 编辑
 
摘要: 从数据库economy表stocks中导入data到数据库human_resources表emp_stocksProblem 1: 无法查看本地临时目录emp_stocks中的数据000000_0,000001_0;原因是:自己居然在hive中的文件系统hdfs用dfs -cat file命令去查询,脑子进水了不是,应该先退出hdfs文件系统hive> quit;然后执行查询 cat /emp_stocks/000000_0; 如果将数据库economy表stocks中要查询的数据导入到hive中hdfs文件系统的一个临时目录,可用dfs -cat file查询。Problem 2: 在 阅读全文
posted @ 2013-03-29 12:56 kalor 阅读(2033) 评论(0) 推荐(0) 编辑
 

2013年3月27日

摘要: http://www.17hadoop.com/shujucangku/97.html 阅读全文
posted @ 2013-03-27 22:30 kalor 阅读(210) 评论(0) 推荐(0) 编辑
 
摘要: 可以通过多种方式将数据导入hive表1.通过外部表导入用户在hive上建external表,建表的同时指定hdfs路径,在数据拷贝到指定hdfs路径的同时,也同时完成数据插入external表。例如:编辑文件test.txt$ cat test.txt 1 hello2 world3 test4 case字段之间以'\t'分割启动hive:$ hive建external表:hive> CREATE EXTERNAL TABLE MYTEST(num INT, name STRING) > COMMENT 'this is a test' ... 阅读全文
posted @ 2013-03-27 22:24 kalor 阅读(422) 评论(0) 推荐(0) 编辑