[
https://issues.apache.org/jira/browse/PHOENIX-1704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14361559#comment-14361559
]
Serhiy Bilousov commented on PHOENIX-1704:
------------------------------------------
Nice work! I still could not run (not related to the patch) so I just looked in
the code. If I miss it just ignore my comment.
It looks like all tests is about calling YEAR from strings CASTed AS TIMESTAMP
(btw casted with TO_TIMESTAMP() what I getting error if I try to use in sqlline
Error: ERROR 605 (42P00): Syntax error. Unknown function: "TO_TIMESTAMP".
(state=42P00,code=605)).
I could not find test where YEAR() tested against actual column data from the
table/view. If you ask me it most important test (in PHOENIX especially due to
all thouse bytes round-trips). So I cautiously would suggest to create a table
with columns of DATE, TIMESTAMP, UNSIGNED_TIME, UNSIGNED_DATE,
UNSIGNED_TIMESTAMP datatype and cover cases with {noformat}SELECT
YEAR(date_time_column) AS y FROM system.catalog LIMIT 1;{noformat}
I would do it in one select to make tests faster but I do not know if it
something PHOENIX community consider right thing to do or preference is to run
each separately.
Hope it of any use.
S.
> Add year() built-in function
> ----------------------------
>
> Key: PHOENIX-1704
> URL: https://issues.apache.org/jira/browse/PHOENIX-1704
> Project: Phoenix
> Issue Type: Bug
> Reporter: Alicia Ying Shu
> Assignee: Alicia Ying Shu
> Attachments: Phoenix-1704-v1.patch, Phoenix-1704-v2.patch,
> Phoenix-1704-v3.patch
>
>
> Support Year() with date and timestamp.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)