uber / queryparser

Parsing and analysis of Vertica, Hive, and Presto SQL.
MIT License
1.08k stars 147 forks source link

Parse CURRENT_TIMESTAMP(1) in vertica #54

Closed asnr closed 4 years ago

asnr commented 4 years ago

In Vertica, CURRENT_TIMESTAMP is a function that accepts one argument, as per the docs. The docs provide this example query demonstrating its usage:

SELECT CURRENT_TIMESTAMP(1) AS time;

Currently, queryparser fails to parse this query. This PR fixes this behaviour.

I've added this example to the tests, but I wasn't sure of where the best place to put it was. Please let me know if it is best placed somewhere else :)

claassistantio commented 4 years ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

h4v0kh3l1 commented 4 years ago

Change looks good, thanks for contributing! I'm guessing sometime after Vertica 7.2 they changed the function arg from optional to required.

If you haven't signed the CLA yet, please do, and I can get this pulled in.

asnr commented 4 years ago

Unfortunately I'm not able to sign the CLA. I will close this PR.