Wednesday, April 26, 2017

mongodb下载

MongoDB各个64位版本下载地址:
http://dl.mongodb.org/dl/win32/x86_64

Saturday, April 22, 2017

eclipse package explorer hierarchical

层级显示

http://stackoverflow.com/questions/3915961/how-to-view-hierarchical-package-structure-in-eclipse-package-explorer

参加上面,ctrl+F10

intellij idea 打开多个project

http://blog.csdn.net/zht666/article/details/47831893

Java执行jar包方式

http://www.cnblogs.com/adolfmc/archive/2012/10/07/2713562.html


用OneJar打包后Java -jar ****.jar总是运行指定的主方法,现在工程中有很多其他的主方法,想要运行指定的。可以用下面的命令:

java -classpath ****.jar ****.****.className [args]
2

Thursday, April 6, 2017

python 添加自己开发的模块

  1. 定位模块文件地址的方法
import codecs
codecs.__file__

打印Python系统路径
import sys
sys.path

  1. 添加自己的模块

here are a few ways. One of the simplest is to create a my-paths.pth file (as described here). This is just a file with the extension .pth that you put into your system site-packages

在site-packages中添加一个文件my-paths.pth,其中pth文件中添加自己的模块地址就行了




扩展 Python的内置函数

Tuesday, March 28, 2017

hive 表及其文件被删除恢复

1.关于hive外部表和内部表的差异,可以查看
http://stackoverflow.com/questions/38318513/does-drop-partition-delete-data-from-external-table-in-hive

大概意思就是内部表,表被drop掉之后,文件也会被删除。

我就是建立了内部表,然后把表drop了,然后文件也被删除了,恢复的办法就是/user/<user>/.Trash 去拷贝或者mv出来,因为我的操作用户是root,对应的user换成root就可以了

具体参见http://stackoverflow.com/questions/20114597/hive-files-on-hdfs-not-being-deleted-when-managed-not-external-table-is-droppe

2.因为通过spark streaming 读取kafka里的反馈日志,并且写入hdfs,文件是orc文件的
CREATE EXTERNAL TABLE test (
    foo string,
    time string,
    bar string
)  PARTITIONED BY (dt string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LOCATION 's3://test.com/';
建表方式如上,当然,orcfile的terminated by ',',另外需要加上一句STORED AS ORC就可以了
然后每天的天分区需要这样加载进去,才能被查询到
LTER TABLE test
    ADD PARTITION (dt='2014-03-05')
    location 's3://test.com/2014-03-05'

方法参考http://stackoverflow.com/questions/22220837/how-to-add-partition-using-hive-by-a-specific-date



ref
https://www.cloudera.com/documentation/enterprise/5-8-x/topics/impala_alter_table.html
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL