本文主要是介绍Java实在读取HDFS写入CSV,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
String currentDay = dateTimeUtil.currentDate();// 检查是否有当前日期的目录fsUtil.checkDirExists(new File(configUtil.readConfig("download.file.path") + currentDay));FSDataInputStream in = null;// 生成以JobID命名的目录String fileName = configUtil.readConfig("download.file.path") + currentDay + "/" + jobID + ".csv";File file = new File(fileName);List<List<String>> dataList = new ArrayList<>();try {String dataPath = configUtil.readConfig("offLine.data.path") + currentDay + "/" + jobID + ".csv/";LOG.info(dataPath);Path path = new Path(dataPath);Configuration configuration = dfsUtil.getHadoopConf();FileSystem hdfs = FileSystem.get(configuration);if (hdfs.exists(path) &&
这篇关于Java实在读取HDFS写入CSV的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!