如何避免在 ScalaTest 运行期间重复使用现有 SparkSession

发布于 2025-01-15 07:48:51 字数 404 浏览 2 评论 0原文

我都会收到警告

 WARN SparkSession$Builder: Using an existing SparkSession; the static sql configurations will not take effect.

每当我运行涉及 SparkSession 的测试时,

。我认为这是因为我使用 SparkSession.builder.{_}.getOrCreate()

并在 {_} 中设置了一些选项。

我不确定警告是什么,甚至表明 .getOrCreate() 肯定需要存在重新使用(获取)现有 SparkSession 的情况?

这不是致命的,但会阻塞我的测试日志。

I get the warning

 WARN SparkSession$Builder: Using an existing SparkSession; the static sql configurations will not take effect.

whenever I run tests which involve engaging a SparkSession.

I think this is because I use SparkSession.builder.{_}.getOrCreate()

with some options set in {_}.

I'm not sure what the warning is even indicating as surely .getOrCreate() necessitates there being a case where you are re-using (getting) an existing SparkSession?

It's not fatal but clogs my test logs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文