Skip to content

Add Spark 4 protobuf definitions and basic working#11

Open
hntd187 wants to merge 6 commits intoapache:masterfrom
hntd187:spark-4
Open

Add Spark 4 protobuf definitions and basic working#11
hntd187 wants to merge 6 commits intoapache:masterfrom
hntd187:spark-4

Conversation

@hntd187
Copy link
Contributor

@hntd187 hntd187 commented Dec 15, 2025

What changes were proposed in this pull request?

Adding the changed protobuf (and new) definitions for Spark 4 this will allow us to implement the new Spark 4 capabilities. This is still a WIP

Why are the changes needed?

Spark updates things, so do we.

Does this PR introduce any user-facing change?

Yes, some interfaces will change, but for the most part user code that worked prior should still work.

How was this patch tested?

By Running the tests, but running this on windows has always been difficult to see how well it actually works.

Was this patch authored or co-authored using generative AI tooling?

No.

@sarutak sarutak marked this pull request as draft December 17, 2025 06:40
@xuanyuanking xuanyuanking marked this pull request as ready for review January 5, 2026 19:23
@sarutak
Copy link
Member

sarutak commented Jan 7, 2026

@xuanyuanking Is this PR still WIP as mentioned in the description right?

This is still a WIP

So, I marked this as draft.

@hntd187
Copy link
Contributor Author

hntd187 commented Jan 16, 2026

I'd just like to merge this to get moving on some follow up PRs so I asked to have this reviewed.

fn from(value: i16) -> Self {
spark::expression::Literal {
#[cfg(feature = "spark-41")]
data_type: Some(spark::DataType::from(5)),

Choose a reason for hiding this comment

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

Using hard-coded numbers to represent Spark data types results in poor readability and maintainability.

value.signed_duration_since(chrono::NaiveDate::from_ymd_opt(1970, 1, 1).unwrap());

spark::expression::Literal {
data_type: Some(spark::DataType::from(14)),

Choose a reason for hiding this comment

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

Isn't #[cfg(feature = "spark-41")] needed here?

Ok(())
}

#[tokio::test]

Choose a reason for hiding this comment

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

Will this test case be rewritten using the Arrow C FFI interface in the future?

common: Some(RelationCommon {
source_info: "".to_string(),
plan_id: Some(plan_id),
#[cfg(spark41)]

Choose a reason for hiding this comment

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

#[cfg(feature = "spark-41")]
        let relation = Relation {
            common: Some(RelationCommon {
                source_info: "".to_string(),
                plan_id: Some(plan_id),
                origin: None,
            }),
            rel_type: Some(rel_type),
        };

        #[cfg(not(feature = "spark-41"))]
        let relation = Relation {
            common: Some(RelationCommon {
                source_info: "".to_string(),
                plan_id: Some(plan_id),
            }),
            rel_type: Some(rel_type),
        };

Maybe it could be changed like this? Would this allow us to avoid defining spark41?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants