‘JavaPackage’对象在AWS Glue上不可调用。

huangapple go评论81阅读模式
英文:

Error: 'JavaPackage' object is not callable on aws glue

问题

我一直在尝试使用 Spark 库 XSDToSchema 在 AWS Glue 上读取 xsd 文件,但它报错说 'JavaPackage' 对象不可调用。

with open('example_xsd.xsd', 'r', encoding='utf-8') as f:
    xml_schema = f.read()
a = spark._jvm.com.databricks.spark.xml.util.XSDToSchema.read(xml_schema)

然后出现这个错误:

'JavaPackage' 对象不可调用

‘JavaPackage’对象在AWS Glue上不可调用。

我尝试在本地机器上运行,结果没问题,但在 AWS Glue 上尝试(包括 Glue 3.0 和 4.0)仍然出现此错误。

英文:

I have been trying to use the spark library XSDToSchema on AWS glue to read xsd file but it gives me 'JavaPackage' object is not callable error

with open('example_xsd.xsd', 'r', encoding='utf-8') as f:
    xml_schema = f.read()
a = spark._jvm.com.databricks.spark.xml.util.XSDToSchema.read(xml_schema)

Then it gives this error:
> JavaPackage' object is not callable

‘JavaPackage’对象在AWS Glue上不可调用。

I tried run on my local machine turns out fine but when try it on glue aws (even glue 3.0 and 4.0) still has this error

答案1

得分: 0

已解决:
我们需要将以下JAR文件添加到依赖的JAR路径中:

  • org.apache.ws.xmlschema_xmlschema-core-2.3.0.jar
  • spark-xml_2.12-0.16.0.jar
  • org.glassfish.jaxb_txw2-3.0.2.jar
英文:

Case solved:
We need to add the following jar files to the Dependent JARs path

  • org.apache.ws.xmlschema_xmlschema-core-2.3.0.jar
  • spark-xml_2.12-0.16.0.jar
  • org.glassfish.jaxb_txw2-3.0.2.jar

huangapple
  • 本文由 发表于 2023年5月7日 12:20:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76192180.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定