Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the way to load hadoop jar #5754

Open
wants to merge 1 commit into
base: feature-1.11.3-update_fate_client
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions python/fate_arch/storage/hdfs/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# limitations under the License.
#
import io
import os
import subprocess
from typing import Iterable

from pyarrow import fs
Expand Down Expand Up @@ -46,12 +48,17 @@ def __init__(
store_type=store_type,
)
# tricky way to load libhdfs
try:
from pyarrow import HadoopFileSystem
#try:
# from pyarrow import HadoopFileSystem

HadoopFileSystem(self.path)
except Exception as e:
LOGGER.warning(f"load libhdfs failed: {e}")
# HadoopFileSystem(self.path)
#except Exception as e:
# LOGGER.warning(f"load libhdfs failed: {e}")

hadoop_classpath = subprocess.check_output(
'$HADOOP_HOME/bin/hadoop classpath --glob', shell=True, executable='/bin/bash'
).decode('utf-8').strip()
os.environ['CLASSPATH'] = hadoop_classpath
self._hdfs_client = fs.HadoopFileSystem.from_uri(self.path)

def check_address(self):
Expand Down