我正在尝试使用以下代码连接到 Teradata:
conf = SparkConf()
conf.set("spark.repl.local.jars", f"{jar_location}//terajdbc4.jar")
conf.set("spark.executor.extraClassPath", f"{jar_location}//terajdbc4.jar")
conf.set("spark.driver.extraClassPath", f"{jar_location}//terajdbc4.jar")
driver = 'com.teradata.jdbc.TeraDriver'
url = "jdbc:teradata://{0}".format(hostname)
spark = SparkSession.builder \
.config(conf=conf) \
.appName(appName) \
.master(master) \
.getOrCreate()
df = spark.read \
.format('jdbc') \
.option('driver', driver) \
.option('url', url) \
.option('query', "Select * from {0}.".format(database) + srcTable) \
.option('user', username) \
.option('password', password) \
.load()
print(df)
我收到以下错误:
py4j.protocol.Py4JJavaError: An error occurred while calling o107.load.
: java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 17.10.00.27]
[Error 1536] [SQLState HY000]
Invalid connection parameter name url
此错误意味着什么?如何解决它?
1条答案
按热度按时间pdtvr36n1#
@Fred是正确的。请执行以下操作: