You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Remus Rusanu (JIRA)" <ji...@apache.org> on 2017/02/27 20:06:45 UTC

[jira] [Comment Edited] (CALCITE-1659) Simplifying CAST(characterLiteral as TIMESTAMP) should round the sub-second fraction

    [ https://issues.apache.org/jira/browse/CALCITE-1659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15886437#comment-15886437 ] 

Remus Rusanu edited comment on CALCITE-1659 at 2/27/17 8:06 PM:
----------------------------------------------------------------

bq. Seems you figured out how to run Quidem tests. How could the documentation be improved? Should we add more documentation to the {{QuidemTest}} class?

In the end the page at https://calcite.apache.org/docs/howto.html#running-integration-tests was the one that got me on the right track. Via trial-and-error I ended up modifying misc.iq and running  the following, because it was quick and yielded the result and diff I needed:
{{noformat}}
>mvn -f core/pom.xml verify -Pti -Dtest=Quidem
{{noformat}}
although I'm not sure the {{-Dtest=...}} does what I think it does, because when the .iq test begin to pass then many more tests run, so I believe I was just lucky in the order. Also, the actual .iq expected result and plan I copy-pasted them from the mvn diff output, I did not locate any output file in core/target to copy from.

As for what to improve, I think the calcite.apache.org HOWTO is the best resource to get the ball rolling. Had the {{QuidemTest}} class contain detailed explanation exactly step by step what to do, I would still probably not stumble upon it, and not know where to start.


was (Author: rusanu):
> Seems you figured out how to run Quidem tests. How could the documentation be improved? Should we add more documentation to the {{QuidemTest}} class?

In the end the page at https://calcite.apache.org/docs/howto.html#running-integration-tests was the one that got me on the right track. Via trial-and-error I ended up modifying misc.iq and running  the following, because it was quick and yielded the result and diff I needed:
{{noformat}}
>mvn -f core/pom.xml verify -Pti -Dtest=Quidem
{{noformat}}
although I'm not sure the {{-Dtest=...}} does what I think it does, because when the .iq test begin to pass then many more tests run, so I believe I was just lucky in the order. Also, the actual .iq expected result and plan I copy-pasted them from the mvn diff output, I did not locate any output file in core/target to copy from.

As for what to improve, I think the calcite.apache.org HOWTO is the best resource to get the ball rolling. Had the {{QuidemTest}} class contain detailed explanation exactly step by step what to do, I would still probably not stumble upon it, and not know where to start.

> Simplifying CAST(characterLiteral as TIMESTAMP) should round the sub-second fraction
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1659
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1659
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Remus Rusanu
>            Assignee: Julian Hyde
>             Fix For: 1.12.0
>
>
> Timestamps are losing sub-second parts after Calcite literal constant reduction.
> {noformat}
> select cast("1970-12-31 15:59:58.174" as TIMESTAMP) from src limit 1;
> {noformat}
> yields {{1970-12-31 15:59:58}} if CBO is enabled in Hive. {{ZonelessTimestamp.toString()}} contains a truncation 0-19 (ie. removes sub-second part from string representation).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)