我正在尝试使用 Spark 读取 sqlite db 文件,但出现以下错误:
Py4JJavaError Traceback (most recent call last)
<ipython-input-101-b7f53ac120a0> in <module>()
----> 1 sqlContext.read.jdbc(url = jdbcUrl, table='the_table', properties=connectionProperties)
/opt/spark/2.4.4/python/pyspark/sql/readwriter.py in jdbc(self, url, table, column, lowerBound, upperBound, numPartitions, predicates, properties)
557 gateway = self._spark._sc._gateway
558 jpredicates = utils.toJArray(gateway, gateway.jvm.java.lang.String, predicates)
--> 559 return self._df(self._jreader.jdbc(url, table, jpredicates, jprop))
560 return self._df(self._jreader.jdbc(url, table, jprop))
561
/opt/spark/2.4.4/python/lib/py4j-src.zip/py4j/java_gateway.py in __call__(self, *args)
1255 answer = self.gateway_client.send_command(command)
1256 return_value = get_return_value(
-> 1257 answer, self.gateway_client, self.target_id, self.name)
1258
1259 for temp_arg in temp_args:
/opt/spark/2.4.4/python/pyspark/sql/utils.py in deco(*a, **kw)
61 def deco(*a, **kw):
62 try:
---> 63 return f(*a, **kw)
64 except py4j.protocol.Py4JJavaError as e:
65 s = e.java_exception.toString()
/opt/spark/2.4.4/python/lib/py4j-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
326 raise Py4JJavaError(
327 "An error occurred while calling {0}{1}{2}.\n".
--> 328 format(target_id, ".", name), value)
329 else:
330 raise Py4JError(
Py4JJavaError: An error occurred while calling o1744.jdbc.
: java.sql.SQLException: Unsupported type NULL
at
我认为问题是: java.sql.SQLException: Unsupported type NULL我正在读取的数据有空值并且不受支持,或者什么 - 但问题是数据有零空值并且它仍然不会读取表。
运行我得到上面的错误显示。
而且我也收到相同的错误消息。
我显然在这里遗漏了一些东西,我能找到的所有线程都是 java 或 scala,虽然我已经尝试了其中建议的各种其他东西,但它似乎没有用。
扬帆大鱼
相关分类