Glue script job error spark_catalog requires a single-part namespace, but got [glue_catalog, foo]

0

I am trying to query an iceberg table via the glue data catalog. This works fine in my visual etl job, but when I try to do it in a script, it's throwing an error. It's likely due to some sort of settings, but I haven't been able to determine what. The code is

glueContext.create_data_frame.from_catalog(
        database="foo",
        table_name="bar",
    )

and the error is AnalysisException: spark_catalog requires a single-part namespace, but got [glue_catalog, foo] The error itself seems to be something that the from_catalog method is doing, and I can't figure out what the root cause is. Any suggestions?

rpost
asked 5 months ago1017 views
1 Answer
0

In the visual job, the Iceberg catalog is configured for you, in your script job, you have to do it yourself, otherwise it won't recognize the "glue_catalog" (which is really the Iceberg catalog backed by Glue).
See https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format-iceberg.html#aws-glue-programming-etl-format-iceberg-enable

profile pictureAWS
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions