Skip to content

Conversation

@res-life
Copy link
Collaborator

@res-life res-life commented Jan 5, 2026

Fixes #14075.

Description

why pipelines failed

For pipelines: rapids_it-iceberg-s3tables-dev and rapids_it-iceberg-dev
pipeline 1.6.x passed, but 1.9.x failed.

From Iceberg 1.9.x, using hadoop type with SparkSessionCatalog will fail with:
"Creating a view is not supported by catalog: spark_catalog"
Iceberg 1.9.x changed the behavior.

For S3TableCatalog, it also does not support view, tested, trying to create a view in s3_catalog.namespace also fails with: "Creating a view is not supported by catalog"

how to fix

Only test rest catalog, skip hadoop and s3table catalog.
rest catalog supports view.

Checklists

  • This PR has added documentation for new or modified features or behaviors.
  • This PR has added new tests or modified existing tests to cover new code paths.
    (Please explain in the PR description how the new code paths are tested, such as names of the new/existing tests that cover them.)
  • Performance testing has been performed and its results are added in the PR description. Or, an issue has been filed with a link in the PR description.

@res-life res-life requested a review from liurenjie1024 January 5, 2026 09:41
@res-life
Copy link
Collaborator Author

res-life commented Jan 5, 2026

build

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 5, 2026

Greptile Summary

This PR fixes Iceberg view test failures that occurred with Iceberg 1.9.x by restricting view tests to only run with REST catalog and ensuring test tables have data before creating views.

Key Changes:

  • Skips view tests when not using REST catalog, as Iceberg 1.9.x removed view support for Hadoop and S3Tables catalogs
  • Adds missing data insertion step after table creation, following the pattern used in other Iceberg test files (e.g., iceberg_merge_test.py)
  • Sets ICEBERG_TEST_CATALOG_TYPE="rest" environment variable in CI to enable proper catalog detection

The fix is well-structured and aligns with existing patterns in the codebase.

Confidence Score: 5/5

Important Files Changed

Filename Overview
integration_tests/src/main/python/conftest.py Added is_iceberg_rest_catalog() helper function to check if REST catalog is enabled via environment variable
integration_tests/src/main/python/iceberg/iceberg_view_test.py Added REST catalog skip condition and data insertion step to fix view test failures in Iceberg 1.9.x
jenkins/spark-tests.sh Added ICEBERG_TEST_CATALOG_TYPE="rest" environment variable to REST catalog test configuration

Sequence Diagram

sequenceDiagram
    participant Test as test_iceberg_view
    participant Factory as spark_tmp_table_factory
    participant Helper as create_iceberg_table
    participant Session as with_cpu_session
    participant Spark as SparkSession
    
    Test->>Factory: get_full_table_name()
    Factory-->>Test: table_name
    
    Test->>Helper: create_iceberg_table(table_name)
    Helper->>Session: with_cpu_session(set_iceberg_table)
    Session->>Spark: Generate schema from df_gen
    Session->>Spark: CREATE TABLE ... USING ICEBERG
    Spark-->>Session: Table created (empty)
    Session-->>Helper: Done
    Helper-->>Test: table_name
    
    Note over Test: NEW: Insert data step added in PR
    Test->>Session: with_cpu_session(insert_data)
    Session->>Spark: gen_df() with iceberg_gens_list
    Session->>Spark: df.writeTo(table_name).append()
    Spark-->>Session: Data inserted
    Session-->>Test: Done
    
    Test->>Session: with_cpu_session(setup_iceberg_view)
    Session->>Spark: CREATE VIEW view_name AS view_sql
    Spark-->>Session: View created
    Session-->>Test: Done
    
    Test->>Test: assert_gpu_and_cpu_are_equal_collect()
    Test->>Spark: SELECT * FROM view_name
    Spark-->>Test: Results verified
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. integration_tests/src/main/python/iceberg/iceberg_view_test.py, line 73-74 (link)

    style: The temporary Spark view created here is never dropped and could accumulate across test runs. Consider adding cleanup after table creation.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Collaborator

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

I'm thinkg that maybe another solution would be to run it on rest catalog only?

@res-life
Copy link
Collaborator Author

res-life commented Jan 6, 2026

Now rapids_it-iceberg-rest-catalog-dev is testing Iceberg 1.6.1, it will not expose this problem.
So another solution is to update rapids_it-iceberg-rest-catalog-dev to test 1.9.2 and add skip for non-rest catalogs.

@res-life res-life closed this Jan 6, 2026
@res-life res-life force-pushed the fix-iceberg-view-tests branch from a25584c to 2940050 Compare January 6, 2026 05:18
Signed-off-by: Chong Gao <res_life@163.com>
@res-life res-life reopened this Jan 6, 2026
@res-life res-life requested a review from a team as a code owner January 6, 2026 05:20
@res-life
Copy link
Collaborator Author

res-life commented Jan 6, 2026

build

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 6, 2026

Greptile's behavior is changing!

From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@res-life res-life requested review from pxLi and yinqingh January 6, 2026 15:33
@res-life
Copy link
Collaborator Author

res-life commented Jan 6, 2026

@yinqingh @pxLi Help review jenkins/spark-tests.sh

Copy link
Collaborator

@abellina abellina left a comment

Choose a reason for hiding this comment

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

LGTM

@sameerz sameerz added the test Only impacts tests label Jan 6, 2026
@sameerz
Copy link
Collaborator

sameerz commented Jan 6, 2026

build

@pxLi
Copy link
Member

pxLi commented Jan 7, 2026

Going to merge this to ensure today's run can cover this change, thanks

@pxLi pxLi added the bug Something isn't working label Jan 7, 2026
@pxLi pxLi merged commit 41e06bb into NVIDIA:main Jan 7, 2026
93 of 98 checks passed
@res-life res-life deleted the fix-iceberg-view-tests branch January 8, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test Only impacts tests

Projects

None yet

6 participants