Skip to content

fix(infra/testing): Enable iceberg spark interops integration tests on ci pipeline - #493

Merged
zeroshade merged 7 commits into
apache:mainfrom
lliangyu-lin:spark-interops-test
Aug 8, 2025
Merged

zeroshade merged 7 commits into
apache:mainfrom
lliangyu-lin:spark-interops-test

Conversation

@lliangyu-lin

@lliangyu-lin lliangyu-lin commented Jul 21, 2025 •

Copy link
Copy Markdown
Contributor

Description

  • Add support for iceberg spark integration tests in ci pipeline
  • Update local spark to execute script with argument to validate producer scenarios.

@github-actions github-actions Bot added the INFRA label Jul 21, 2025
@lliangyu-lin
lliangyu-lin marked this pull request as ready for review July 22, 2025 22:52
@lliangyu-lin

lliangyu-lin commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor Author

I'm thinking we should just use the testcontainer api to manage the container lifecycles instead of compose in CI and skip the compose in testcontainers by checking whether s3 endpoint var is set. In current setup, we won't be able to get the stack handler to run executions...

Comment thread table/transaction_test.go
iceberg.NestedField{ID: 14, Name: "small_dec", Type: iceberg.DecimalTypeOf(8, 2)},
iceberg.NestedField{ID: 15, Name: "med_dec", Type: iceberg.DecimalTypeOf(16, 2)},
iceberg.NestedField{ID: 16, Name: "large_dec", Type: iceberg.DecimalTypeOf(24, 2)},
iceberg.NestedField{ID: 17, Name: "list", Type: &iceberg.ListType{

@lliangyu-lin lliangyu-lin Jul 22, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was planning to test more complexed schema with other complex data types, but is getting execeptions in arrow to iceberg schema visitor when AppendTable with struct or map. I'm planning to add those tests later in separate PR.

@laskoviymishka laskoviymishka left a comment

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.

adding to CI - seems good idea, but i have doubts about writing actual verification code in python.
Is there any way to bring this logic into go-test instead?

Comment thread table/transaction_test.go
output, err := io.ReadAll(stdout)
err = recipe.ExecuteSpark(s.T(), "./validation.py", "--test", "TestReadSpecUpdate")
s.Require().NoError(err)
strings.HasSuffix(string(output), `

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.

Why not verify output?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was thinking we could do more fine grained verification in python since it has access to dataframe. But verifying output also works. Let me update to verify output in next commit.

Comment thread table/transaction_test.go Resolved
@lliangyu-lin
lliangyu-lin force-pushed the spark-interops-test branch from bdb6336 to 2a2d97f Compare July 25, 2025 00:07
@lliangyu-lin

Copy link
Copy Markdown
Contributor Author

@zeroshade I fixed the previous issue where spark container cannot be found. Could you help re-enable the workflow?

@lliangyu-lin

Copy link
Copy Markdown
Contributor Author

@zeroshade @laskoviymishka Feel free to take another pass when you get a chance.

@zeroshade

Copy link
Copy Markdown
Member

I'll try to look this over today or tomorrow! Thanks for your patience!

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some nitpicks, but otherwise is looking good

Comment thread internal/recipe/Dockerfile Resolved

import (
"bytes"
_ "embed"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why rearranging the imports?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Somehow I remember I was getting lint issue, but it's not there when I checked again.

Comment thread internal/recipe/local_spark.go Outdated
func ExecuteSpark(t *testing.T, scriptPath string, args ...string) (string, error) {
cli, err := client.NewClientWithOpts(
client.FromEnv,
client.WithVersion("1.48"), // Use explicit version to avoid compatibility issues

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be an env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, added the API env var in CI and fallback to use the client internal default

@lliangyu-lin
lliangyu-lin requested a review from zeroshade August 7, 2025 21:29
@zeroshade
zeroshade merged commit 03bd440 into apache:main Aug 8, 2025
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.

3 participants