You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yun Zhao (JIRA)" <ji...@apache.org> on 2015/09/26 03:30:04 UTC
[jira] [Created] (SPARK-10837) TimeStamp could not work on sparksql
very well
Yun Zhao created SPARK-10837:
--------------------------------
Summary: TimeStamp could not work on sparksql very well
Key: SPARK-10837
URL: https://issues.apache.org/jira/browse/SPARK-10837
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 1.5.0
Reporter: Yun Zhao
create a file as follows:
{quote}
2015-09-02 09:06:00.000
2015-09-02 09:06:00.001
2015-09-02 09:06:00.100
2015-09-02 09:06:01.000
{quote}
Then upload it to hdfs, for example,put it to /test/testTable.
create table:
{quote}
CREATE EXTERNAL TABLE `testTable`(`createtime` timestamp) LOCATION '/test/testTable';
{quote}
process sqls:
{quote}
select * from testTable where createtime = "2015-09-02 09:06:00.000";
select * from testTable where createtime > "2015-09-02 09:06:00.000";
select * from testTable where createtime >= "2015-09-02 09:06:00.000";
{quote}
The set of ">=" is not union set of "=" and ">".
but if process sqls as follows:
{quote}
select * from testTable where createtime = timestamp("2015-09-02 09:06:00.000");
select * from testTable where createtime > timestamp("2015-09-02 09:06:00.000");
select * from testTable where createtime >= timestamp("2015-09-02 09:06:00.000");
{quote}
There's no such former problem.
User *explain extended* to find the difference of sqls:
When uses "=","2015-09-02 09:06:00.000" is transfered to timestamp.
When uses ">" or ">=",createtime is transfered to String.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org