Skip to content

Commit

Permalink
fix: init session as proxy user
Browse files Browse the repository at this point in the history
  • Loading branch information
link3280 committed Mar 31, 2024
1 parent acba7ad commit 3e2cb05
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.LineNumberReader;
Expand Down Expand Up @@ -186,7 +188,7 @@ private class ExecutionTask implements Supplier<ExecutionStatus> {
private final String catalog;
private final TableMetaStore tableMetaStore;

private final String proxyUser;
@Nullable private final String proxyUser;

public ExecutionTask(
String catalog,
Expand All @@ -210,7 +212,8 @@ public ExecutionTask(
@Override
public ExecutionStatus get() {
try {
return metaStore.doAs(
return metaStore.doAsImpersonating(
proxyUser,
() -> {
TerminalSession session = lazyLoadSession(this);
executionResult.appendLog("fetch terminal session: " + sessionId);
Expand Down

0 comments on commit 3e2cb05

Please sign in to comment.