harrisiirak / webhdfs

Node.js WebHDFS REST API client
MIT License
89 stars 42 forks source link

faced "java.lang.UnsupportedOperationException","message":"Operation APPEND is not supported."}} (error 400) #34

Open cicicao opened 1 year ago

cicicao commented 1 year ago

Doing below faced error: curl http://:50073/WebWasb/webhdfs/v1/user/hadoop/HiveTableDDL.sql.tmp?op=APPEND

WebHdfsException: 400 Client Error: Bad Request for url: http://10.151.252.24:50073/WebWasb/webhdfs/v1/user/hadoop/HiveTableDDL.sql.tmp?op=APPEND&user.name=hue&doas=hadoop {"RemoteException":{"exception":"UnsupportedOperationException","javaClassName":"java.lang.UnsupportedOperationException","message":"Operation APPEND is not supported."}} (error 400) [18/Nov/2022 10:00:38 +0800] access INFO 192.168.219.247 hadoop - "POST /filebrowser/upload/file HTTP/1.1" returned in 498ms 200 2584

{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"No enum constant org.apache.hdinsight.operations.GetOperation.APPEND"}}

Hadoop: 3.1.1

Could you please tell what's the reason and how to mitigate it?

cicicao commented 1 year ago

I highly doubt Webwasb doesn't support APPEND

https://github.com/cloudera/hue/blob/74110da853ca39414db64e64adbda3b116a7c419/desktop/libs/hadoop/src/hadoop/fs/webhdfs.py#L650

below is webhdfs's py code: def append(self, data): if 'w' not in self.mode: raise IOError(errno.EINVAL, ("File not open for writing")) self._fs.append(self._path, data=data)

def append(self, path, data): """ append(path, data)

Append data to a given file.
"""
path = Hdfs.normpath(path)
params = self._getparams()
params['op'] = 'APPEND'
self._invoke_with_redirect('POST', path, params, data)