Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(csharp/src/Drivers/Apache): fix float data type handling for tests on Databricks Spark #2283

Conversation

birschick-bq
Copy link
Contributor

Fixes the handling of float data type when running the integration tests on Databricks Spark

closes #2281

@@ -139,6 +139,13 @@ public override string GetInsertStatement(string tableName, string columnName, s
public override SampleDataBuilder GetSampleDataBuilder()
{
SampleDataBuilder sampleDataBuilder = new();
Type floatNetType = ServerType == SparkServerType.Databricks ? typeof(float) : typeof(double);
Type floatArrowType = ServerType == SparkServerType.Databricks ? typeof(FloatType) : typeof(DoubleType);
object floatValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

In principle, it probably should be float for both. I imagine the reason we get doubles via Thrift is that TColumn doesn't define a TFloatColumn, only a TDoubleColumn. But if we know from the schema that it should be a float then we should probably be doing a conversion in the driver.

Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

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

Thanks Bruce!

@CurtHagenlocher CurtHagenlocher merged commit a19bc0b into apache:main Oct 30, 2024
8 checks passed
@birschick-bq birschick-bq deleted the dev/birschick-bq/databricks-float-test-fix branch November 1, 2024 18:02
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.

csharp: integration tests (ClientTests) fail for Databricks data source due to float type incompatibility
2 participants