Skip to content

Conversation

@nongli
Copy link
Contributor

@nongli nongli commented Nov 13, 2015

Hive has since changed this behavior as well. https://issues.apache.org/jira/browse/HIVE-3454

@cloud-fan
Copy link
Contributor

Good catch! The currently behaviour looks wierd to me, how does hive handle this? cc @yhuai

@SparkQA
Copy link

SparkQA commented Nov 13, 2015

Test build #45842 has finished for PR 9685 at commit 9aa668c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * case class StddevSamp(child: Expression,\n * case class StddevPop(\n * class TypedColumn[-T, U](\n

@nongli
Copy link
Contributor Author

nongli commented Nov 13, 2015

Good catch! The currently behaviour looks wierd to me, how does hive handle this? cc @yhuai

It looks like Hive fixed this in 1.2. https://issues.apache.org/jira/browse/HIVE-3454

@yhuai
Copy link
Contributor

yhuai commented Nov 13, 2015

Seems we need to update those golden files. I believe we can set HIVE_HOME to hive 1.2.1's dir and delete those golden files. Then, when we run those tests again, we will first let Hive generate results.

…stently treat int in seconds.

The current behavior is odd but there were a few tests that verified it. Not sure if there
is a particular reason it is this way.
@yhuai
Copy link
Contributor

yhuai commented Nov 19, 2015

Seems Hive is still wrong when the data type is int. See

hive> SELECT CAST(CAST(-1200 AS TIMESTAMP) AS INT);
OK
-2
Time taken: 0.047 seconds, Fetched: 1 row(s)
hive> SELECT CAST(CAST(-1200.0 AS TIMESTAMP) AS INT);
OK
-1200
Time taken: 0.046 seconds, Fetched: 1 row(s)

Let's delete those golden files and create our own test (using test(...) {...} instead of using createQueryTest(..., ...)).

@nongli nongli changed the title [SPARK-11724] [SQL] Change casting between int and timestamp to consi… [SPARK-11724] [SQL] Change casting between int and timestamp to consistently treat int in seconds. Nov 19, 2015
@SparkQA
Copy link

SparkQA commented Nov 20, 2015

Test build #46364 has finished for PR 9685 at commit c4f2da1.

  • This patch fails from timeout after a configured wait of 250m.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor

yhuai commented Nov 20, 2015

test this please

@SparkQA
Copy link

SparkQA commented Nov 20, 2015

Test build #46391 has finished for PR 9685 at commit c4f2da1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems we do not include the new golden file? I can generate it tomorrow.

@SparkQA
Copy link

SparkQA commented Nov 20, 2015

Test build #46435 has finished for PR 9685 at commit 347de98.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor

yhuai commented Nov 20, 2015

LGTM. Thank you for the fix! Merging it to master and branch 1.6.

asfgit pushed a commit that referenced this pull request Nov 20, 2015
…tently treat int in seconds.

Hive has since changed this behavior as well. https://issues.apache.org/jira/browse/HIVE-3454

Author: Nong Li <nong@databricks.com>
Author: Nong Li <nongli@gmail.com>
Author: Yin Huai <yhuai@databricks.com>

Closes #9685 from nongli/spark-11724.

(cherry picked from commit 9ed4ad4)
Signed-off-by: Yin Huai <yhuai@databricks.com>
@asfgit asfgit closed this in 9ed4ad4 Nov 20, 2015
@nongli nongli deleted the spark-11724 branch November 25, 2015 05: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.

4 participants