hdfs icon indicating copy to clipboard operation
hdfs copied to clipboard

An error is reported when reading a file in the HAR package

Open bigcat133 opened this issue 1 year ago • 0 comments

version info: Hadoop 2.6.0-cdh5.11.0 github.com/colinmarc/hdfs v1.1.3 go 1.18

build env: GIN_MODE=release &&
CGO_ENABLED=1 &&
GOOS=linux &&
GOARCH=amd64 && \

code:

func main() {
	config.SetConfigPath("./config.toml")

	file_path := "/user/poma/2023121001.har"
	file_name := "8a0c7e585f86c15ca1f1ce9b405a4a3f"

	client := hdfs.New("namenode2")
	f_info, err := client.Stat(file_path)
	if err != nil {
		fmt.Printf("stat err: %s\n", err.Error())
	} else {
		fmt.Printf("file info: %v\n", f_info)
		file_path = filepath.Join(file_path, file_name)
		file_path = fmt.Sprintf("har://%s", file_path)
		f_hand, err := client.Open(file_path)
		if err != nil {
			fmt.Printf("open err: %s\n", err.Error())
		} else {
			f_hand.Close()
		}
	}

}

Error Info: open err: open har:///user/poma/2023121001.har/8a0c7e585f86c15ca1f1ce9b405a4a3f: getFileInfo call failed with ERROR_APPLICATION (org.apache.hadoop.fs.InvalidPathException)

bigcat133 avatar Dec 13 '23 09:12 bigcat133