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

[SPARK-51034][SQL] Reformat Describe As JSON statistics dict for parse-ability #49728

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor timestamp formatter and add test
asl3 committed Jan 29, 2025
commit caf34ab3c9617c6872fdedab05cd676e70fc8d81
Original file line number Diff line number Diff line change
@@ -55,6 +55,15 @@ class DescribeTableSuite extends command.DescribeTableSuiteBase
Row("# col_name", "data_type", "comment"),
Row("s.id", "int", null),
Row("s.a", "bigint", null)))

// example date format: Mon Nov 01 12:00:00 UTC 2021
val timeRegex = raw"""^[A-Z][a-z]{2} [A-Z][a-z]{2} [ 0-9][0-9]
|[0-9]{2}:[0-9]{2}:[0-9]{2} [A-Z]{3,4}
|[0-9]{4}$""".stripMargin.r

val createdTimeValue = descriptionDf.filter("col_name = 'Created Time'")
.collect().head.getString(1)
assert(timeRegex.matches(createdTimeValue))
}
}