简体   繁体   English

使用 databricks-connect 连接到 python 中的数据块时出错

[英]Error connecting to databricks in python with databricks-connect

I'm using databricks-connect on mac using pycharm but after I finished the configuration and tried to run databricks-connect test , I got the following error and have no idea what the problem is.我在 mac 上使用 databricks-connect 使用 pycharm 但在我完成配置并尝试运行databricks-connect test后,我收到以下错误并且不知道问题是什么。 I followed this documentation: https://docs.databricks.com/user-guide/dev-tools/db-connect.html我遵循了这个文档: https://docs.databricks.com/user-guide/dev-tools/db-connect.html

The error message is as below:错误信息如下:

scala> spa
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/bin/databricks-connect", line 11, in 
    load_entry_point('databricks-connect==5.3.1', 'console_scripts', 'databricks-connect')()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyspark/databricks_connect.py", line 244, in main
    test()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyspark/databricks_connect.py", line 213, in test
    raise ValueError("Scala command failed to produce correct result")
ValueError: Scala command failed to produce correct result

Maybe your Java/Python version does not comply.也许您的 Java/Python 版本不符合要求。 Check your cluster, which Python version does it use (in my case it was 3.5).检查您的集群,它使用的是哪个 Python 版本(在我的情况下是 3.5)。

And what's most important: check which JDK version do you have on your computer.最重要的是:检查您的计算机上的 JDK 版本。 In my case, I've had the latest one, which was not supported by databricks-connect .就我而言,我有最新的一个,它不受databricks-connect支持。 It needs to run on JDK 8.它需要在 JDK 8 上运行。

I would make sure you are using the right version of the Databricks Runtime (DB Connect only currently supports 5.1-5.5).我会确保您使用的是正确版本的 Databricks Runtime(DB Connect 目前仅支持 5.1-5.5)。 Since these is a limit on the DBR that works with DB connect, you'll have to make sure you match the python version as well (for the base Databricks runtime, I believe it is 3.5.x).由于这些是与 DB connect 一起使用的 DBR 的限制,因此您必须确保您也匹配 python 版本(对于基本 Databricks 运行时,我相信它是 3.5.x)。

To ignore the RUNTIME version, export an environment variable that resolves:要忽略运行时版本,导出解析的环境变量:

export DEBUG_IGNORE_VERSION_MISMATCH=1导出 DEBUG_IGNORE_VERSION_MISMATCH=1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM