Skip to content

Spark 3.5: Fix incorrect catalog loaded in TestCreateActions#10952

Merged
nastra merged 3 commits into
apache:mainfrom
manuzhang:test-create-actions
Aug 22, 2024
Merged

Spark 3.5: Fix incorrect catalog loaded in TestCreateActions#10952
nastra merged 3 commits into
apache:mainfrom
manuzhang:test-create-actions

Conversation

@manuzhang
Copy link
Copy Markdown
Member

@manuzhang manuzhang commented Aug 16, 2024

Before this fix, HiveCatalog is loaded instead of HadoopCatalog due to spark sql config is not cleared up after each test in TestCreateActions.
After the correct catalog is loaded, more migrate tests need to be skipped for HadoopCatalog.

cc @chinmay-bhat @nastra

@manuzhang manuzhang marked this pull request as draft August 16, 2024 17:06
@github-actions github-actions Bot added the spark label Aug 16, 2024
@manuzhang manuzhang force-pushed the test-create-actions branch from 5ba0ed9 to fdf18aa Compare August 17, 2024 16:53
@manuzhang manuzhang changed the title Spark 3.5: Verify Iceberg catalog in TestCreateActions Spark 3.5: Skip hadoop based catalog in migration test Aug 18, 2024
@manuzhang manuzhang marked this pull request as ready for review August 18, 2024 15:24
@manuzhang manuzhang force-pushed the test-create-actions branch from 445f9b6 to d9c3bc6 Compare August 19, 2024 03:43
@manuzhang manuzhang closed this Aug 19, 2024
@manuzhang manuzhang reopened this Aug 19, 2024
@manuzhang manuzhang changed the title Spark 3.5: Skip hadoop based catalog in migration test Spark 3.5: Fix incorrect catalog loaded in TestCreateActions Aug 19, 2024
@manuzhang manuzhang force-pushed the test-create-actions branch from d9c3bc6 to ac6973e Compare August 21, 2024 16:04
Copy link
Copy Markdown
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM, but I would probably reference spark_catalog directly, since that's the catalog that seems to cause issues

@manuzhang manuzhang force-pushed the test-create-actions branch from ac6973e to 3b9808c Compare August 22, 2024 08:24
this.catalog = (TableCatalog) spark.sessionState().catalogManager().catalog(catalogName);

if (!catalogName.equals("spark_catalog")) {
spark.conf().set("spark.sql.catalog.spark_catalog", SparkSessionCatalog.class.getName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this ever needs to be set?

Copy link
Copy Markdown
Member Author

@manuzhang manuzhang Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to migrate from a non-Iceberg catalog table since we unset spark.sql.catalog.spark_catalog now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, this is probably my bad due to my earlier suggestion. I think we can remove setting this here if we remove spark.conf().unset("spark.sql.catalog.spark_catalog");. That way all tests should still pass

@nastra
Copy link
Copy Markdown
Contributor

nastra commented Aug 22, 2024

thanks for fixing this @manuzhang

@nastra nastra merged commit 0446178 into apache:main Aug 22, 2024
manuzhang added a commit to manuzhang/iceberg that referenced this pull request Aug 30, 2024
manuzhang added a commit to manuzhang/iceberg that referenced this pull request Sep 1, 2024
manuzhang added a commit to manuzhang/iceberg that referenced this pull request Sep 2, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
@manuzhang manuzhang deleted the test-create-actions branch March 2, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants