英文:
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' 对象不可调用
我尝试在本地机器上运行,结果没问题,但在 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
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论