Skip to content

Commit cb6765d

Browse files
authored
client send hdfs user pass (#92)
1 parent 937051d commit cb6765d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

proto/sqlflow/proto/sqlflow.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ message Session {
2727
// for loading CSV to hive
2828
string hive_location = 5;
2929
string hdfs_namenode_addr = 6;
30+
string hdfs_user = 7;
31+
string hdfs_pass = 8;
3032
}
3133

3234
// SQL statements to run

sqlflow/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def sql_request(self, sql):
6969
user_id = os.getenv("SQLFLOW_USER_ID", "")
7070
hive_location = os.getenv("SQLFLOW_HIVE_LOCATION", "")
7171
hdfs_namenode_addr = os.getenv("SQLFLOW_HDFS_NAMENODE_ADDR", "")
72+
# environment variables JUPYTER_HADOOP_USER, JUPYTER_HADOOP_PASS stores the user's hdfs credentials.
73+
hdfs_user = os.getenv("JUPYTER_HADOOP_USER", "")
74+
hdfs_pass = os.getenv("JUPYTER_HADOOP_PASS", "")
7275
if exit_on_submit_env.isdigit():
7376
exit_on_submit = bool(int(exit_on_submit_env))
7477
else:
@@ -78,7 +81,9 @@ def sql_request(self, sql):
7881
exit_on_submit=exit_on_submit,
7982
user_id=user_id,
8083
hive_location=hive_location,
81-
hdfs_namenode_addr=hdfs_namenode_addr)
84+
hdfs_namenode_addr=hdfs_namenode_addr,
85+
hdfs_user=hdfs_user,
86+
hdfs_pass=hdfs_pass)
8287
try:
8388
sql = self._expander.expand(sql)
8489
except Exception as e:

0 commit comments

Comments
 (0)