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

[FEATURE REQUEST]: Support System.Decimal in CreateDataFrame API #818

Open
jgavin opened this issue Feb 3, 2021 · 4 comments
Open

[FEATURE REQUEST]: Support System.Decimal in CreateDataFrame API #818

jgavin opened this issue Feb 3, 2021 · 4 comments
Labels
enhancement New feature or request triaged

Comments

@jgavin
Copy link

jgavin commented Feb 3, 2021

Is your feature request related to a problem? Please describe.
I'd like to be able to use the System.Decimal type when using the CreateDataFrame API. Currently when running the following:

decimal? minValue = 4.0M;
decimal? maxValue = 5.0M;
var df = sparkSession.CreateDataFrame(
    new List<GenericRow>
    {
        new GenericRow(
            new object[]
            {
                "1234",
                minValue,
                maxValue,
            }),
    },
    new StructType(
        new List<StructField>()
        {
            new StructField("id", new StringType()),
            new StructField("minValue", new DecimalType()),
            new StructField("maxValue", new DecimalType()),
        }));
df.Show();

We see the following error:
System.NotSupportedException: 'Type System.Decimal not supported yet'

This presents issues in trying to unit test code that reads decimal types from a DB.

Describe the solution you'd like
To be able to create Dataframes with Decimals without an error 😄

Describe alternatives you've considered
Alternatives for us might be to change the type being read from the DB, but this is a significant challenge - for now we are unable to unit test this code.

Additional context
N/A

@jgavin jgavin added the enhancement New feature or request label Feb 3, 2021
@Niharikadutta
Copy link
Collaborator

Thanks @jgavin for creating this issue, we are yet to add support for System.Decimal and will get back to you about the timeline of getting this in.

@dbeavon
Copy link

dbeavon commented Apr 17, 2021

@Niharikadutta

Did you see that decimals were added to Apache Arrow?

This happened recently. Was that a prerequisite? Decimal types are pretty critical for us as well.

@GoEddie
Copy link
Contributor

GoEddie commented Sep 6, 2021

Hi @Niharikadutta + @imback82 - is there a reason for no decimal or is just waiting for development? is this a good issue to take?

@imback82
Copy link
Contributor

imback82 commented Sep 7, 2021

Hi @GoEddie, this is just waiting for development and a good issue to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged
Projects
None yet
Development

No branches or pull requests

5 participants