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

[AMORO-2862] fix bug: A null pointer error occurs when using S3 as Storage when using the kyuubi terminal. #2863

Merged
merged 8 commits into from
May 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -123,7 +124,7 @@ public TerminalSession create(TableMetaStore metaStore, Configurations configura
sessionConf.put("jdbc.url", kyuubiJdbcUrl);
Properties properties = new Properties();

if (!metaStore.isKerberosAuthMethod()) {
if (!metaStore.isKerberosAuthMethod() && Objects.nonNull(metaStore.getHadoopUsername())) {
properties.put(JdbcConnectionParams.AUTH_USER, metaStore.getHadoopUsername());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about checking if the value is null before putting it into properties and configuration?
I think it will be simpler if we fix it this way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I have made the changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use one condition to fix this, WDYT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use one condition to fix this, WDYT

Okay, I've merged it into one.thinks.

sessionConf.put(JdbcConnectionParams.AUTH_USER, metaStore.getHadoopUsername());
}
Expand Down
Loading