Skip to content

Commit 866fc6e

Browse files
author
yuzelin
committed
T
1 parent 31abdd2 commit 866fc6e

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.github/workflows/paimon-python-checks.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,34 @@ jobs:
4343
with:
4444
java-version: ${{ env.JDK_VERSION }}
4545
distribution: 'adopt'
46+
- name: Set up hadoop dependency
47+
run:
48+
mkdir -p ${{ github.workspace }}/temp
49+
curl -L -o ${{ github.workspace }}/temp/bundled-hadoop.jar \
50+
https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
51+
ls -al ${{ github.workspace }}/temp
52+
if [ ! -f ${{ github.workspace }}/temp/bundled-hadoop.jar ]; then
53+
echo "JAR download failed."
54+
exit 1
4655
- name: Run lint-python.sh
56+
env:
57+
_PYPAIMON_HADOOP_CLASSPATH: ${{ github.workspace }}/temp/bundled-hadoop.jar
4758
run: |
4859
chmod +x dev/lint-python.sh
4960
./dev/lint-python.sh
61+
62+
63+
64+
65+
# Create a temporary directory
66+
- name: Create temporary directory
67+
run: mkdir -p ${{ github.workspace }}/temp
68+
69+
# Download the JAR file and save to the temporary directory
70+
- name: Download JAR
71+
run: |
72+
curl -L -o ${{ github.workspace }}/temp/your-dependency.jar https://central.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
73+
74+
# List files in the temporary directory
75+
- name: List downloaded files
76+
run: ls -al ${{ github.workspace }}/temp

paimon_python_java/gateway_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _get_hadoop_classpath(env):
103103
return env[constants.PYPAIMON_HADOOP_CLASSPATH]
104104

105105
if 'HADOOP_CLASSPATH' in env:
106-
return None
106+
return env['HADOOP_CLASSPATH']
107107
else:
108108
raise EnvironmentError(f"You haven't set '{constants.PYPAIMON_HADOOP_CLASSPATH}', \
109109
and 'HADOOP_CLASSPATH' is also not set. Ensure one of them is set.")

paimon_python_java/tests/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424

2525
def setup_hadoop_bundle_jar(hadoop_dir):
26+
if constants.PYPAIMON_HADOOP_CLASSPATH in os.environ:
27+
return
28+
2629
url = 'https://repo.maven.apache.org/maven2/org/apache/flink/' \
2730
'flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar'
2831

0 commit comments

Comments
 (0)