RHadoop-Hive
/1、本地文件读取
val local_file_1 = sc.textFile("/home/hadoop/sp.txt")
val local_file_2 = sc.textFile("file://home/hadoop/sp.txt")

//2、当前目录下的文件
val file1 = sc.textFile("sp.txt")

//3、HDFS文件
val hdfs_file1 = sc.textFile("hdfs://192.168.66.81:9000/data/input/sp.txt")

//4、多文件读取
val file2 = sc.textFile("sp.txt,a.txt,b.txt")

//5、全目录读取
val hdfs_file2 = sc.textFile("hdfs://192.168.66.81:9000/data/input/")

//6、通配符匹配
val file2 = sc.textFile("file://home/hadoop/*.txt")

//7、读取压缩文件
val file3 = sc.textFile("file://home/hadoop/sp.gz")

  

分类:

技术点:

相关文章:

  • 2023-04-01
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-05-26
  • 2022-01-17
猜你喜欢
  • 2021-10-30
  • 2021-08-29
  • 2021-11-19
  • 2021-05-26
  • 2021-07-19
  • 2021-11-23
  • 2021-08-17
相关资源
相似解决方案