Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16004] [SQL] Correctly display "Last Access Time" of CatalogTable - #13720
[SPARK-16004] [SQL] Correctly display "Last Access Time" of CatalogTable#13720bomeng wants to merge 10 commits into
Conversation
SparkQA
commented
Jun 17, 2016
Test build #60668 has finished for PR 13720 at commit
|
SparkQA
commented
Jun 17, 2016
Test build #60677 has finished for PR 13720 at commit
|
bomeng
commented
Jun 20, 2016
@srowen please review. thanks! |
| s"Created: ${new Date(createTime).toString}", | ||
| s"Last Access: ${new Date(lastAccessTime).toString}", | ||
| "Last Access: " + | ||
| (if (lastAccessTime == -1) "UNKNOWN" else new Date(lastAccessTime).toString), |
There was a problem hiding this comment.
I don't feel strongly about it, but seems like elsewhere an empty string is used for no values. This seems slightly preferable.
There was a problem hiding this comment.
Here is the code from Hive (it is using 0 as initial last access value):
File: MetaDataFormatUtils.java
private static String formatDate(long timeInSeconds) {
if (timeInSeconds != 0) {
Date date = new Date(timeInSeconds * 1000);
return date.toString();
}
return "UNKNOWN";
}
There was a problem hiding this comment.
Yes, but the rest of this code doesn't use that logic. It returns "" in code around this area.
There was a problem hiding this comment.
I prefer empty string here, cc @yhuai@liancheng what do you think?
There was a problem hiding this comment.
Empty string looks fine to me.
SparkQA
commented
Jun 22, 2016
Test build #60968 has finished for PR 13720 at commit
|
bomeng
commented
Jun 23, 2016
@cloud-fan Is this one worth to be fixed? |
| private def describeSchema(schema: Seq[CatalogColumn], buffer: ArrayBuffer[Row]): Unit = { | ||
| schema.foreach { column => | ||
| append(buffer, column.name, column.dataType.toLowerCase, column.comment.orNull) | ||
| append(buffer, column.name, column.dataType.toLowerCase, column.comment.getOrElse("")) |
There was a problem hiding this comment.
this is a behaviour changing. The result is not only used to display, but also used as a table to be queried later. I'm not sure it worth. cc @yhuai
There was a problem hiding this comment.
Yea. If it is null, let's keep it as null. Changing a null to an empty string actually destroys the information.
There was a problem hiding this comment.
Agree, a column without any comment (null) is different from a column with a comment that is an empty string.
cloud-fan
commented
Jun 24, 2016
For the test, currently we only have one |
bomeng
commented
Jun 24, 2016
ok, i will work on it based on comments. Thanks. |
SparkQA
commented
Jun 24, 2016
Test build #61196 has finished for PR 13720 at commit
|
SparkQA
commented
Jun 27, 2016
Test build #61311 has finished for PR 13720 at commit
|
bomeng
commented
Jun 27, 2016
@cloud-fan please review again, thanks. |
gatorsmile
commented
May 23, 2017
@bomeng Cloud you resolve the conflicts? |
| } | ||
| } | ||
| test("Describe Table") { |
There was a problem hiding this comment.
This test case does not verify the issue you fixed, I think
HyukjinKwon
commented
Jun 2, 2017
ping @bomeng |
# What changes were proposed in this pull request? This PR proposes to close stale PRs, mostly the same instances with apache#18017Closesapache#11459Closesapache#13833Closesapache#13720Closesapache#12506Closesapache#12456Closesapache#12252Closesapache#17689Closesapache#17791Closesapache#18163Closesapache#17640Closesapache#17926Closesapache#18163Closesapache#12506Closesapache#18044Closesapache#14036Closesapache#15831Closesapache#14461Closesapache#17638Closesapache#18222 Added: Closesapache#18045Closesapache#18061Closesapache#18010Closesapache#18041Closesapache#18124Closesapache#18130Closesapache#12217 Added: Closesapache#16291Closesapache#17480Closesapache#14995 Added: Closesapache#12835Closesapache#17141 ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closesapache#18223 from HyukjinKwon/close-stale-prs.
What changes were proposed in this pull request?
A few issues found when running "describe extended | formatted [tableName]" command:
Comments fields display "null" instead of empty string when commend is None;How was this patch tested?
Currently, I have manually tested them - it is very straight-forward to test, but hard to write test cases for them.