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

DateTypes or TimestampTypes using createDF #112

Open
apple-corps opened this issue Sep 24, 2022 · 0 comments
Open

DateTypes or TimestampTypes using createDF #112

apple-corps opened this issue Sep 24, 2022 · 0 comments

Comments

@apple-corps
Copy link

apple-corps commented Sep 24, 2022

I tried to figure out how to use createDF to validate dataFrames with DateTypes. I tried creating DateType while using createDF. It appears that DateType might be a private class of Spark, so perhaps it's not possible. But mentioning that in the Readme, or having an issue might help someone else out if it isn't possible. Otherwise perhaps I am just explaining my ignorance.

val expectedDF = spark.createDF(
        List
        (DateTimeUtils.stringToDate(UTF8String.fromString("1995-07-25"), ZoneId.of("UTC")).get, "nextDayTopRanking", "4", "1"),

        List(
          ("date", DateType, true),
          ("source", StringType, false),
          ("count", LongType, false),
          ("dense_rank", IntegerType, true)
        )
      )
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

No branches or pull requests

1 participant