Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support more datetime format #3800

Open
HarrisChu opened this issue Jan 25, 2022 · 2 comments
Open

support more datetime format #3800

HarrisChu opened this issue Jan 25, 2022 · 2 comments
Labels
type/enhancement Type: make the code neat or more efficient

Comments

@HarrisChu
Copy link
Contributor

support more datetime format:

  • RFC3339
  • RFC2822
  • ISO8601
  • "2011-08-17T11:10:21.570+0000"
(root@nebula) [(none)]> yield datetime("2011-08-17T11:10:21.5Z")
+------------------------------------+
| datetime("2011-08-17T11:10:21.5Z") |
+------------------------------------+
| BAD_DATA                           |
+------------------------------------+
Got 1 rows (time spent 648/2459 us)

Tue, 25 Jan 2022 02:14:54 UTC

(root@nebula) [(none)]> yield datetime("Wed, 17 Aug 2011 11:10:21 GMT")
+-------------------------------------------+
| datetime("Wed, 17 Aug 2011 11:10:21 GMT") |
+-------------------------------------------+
| BAD_DATA                                  |
+-------------------------------------------+
Got 1 rows (time spent 557/2347 us)

Tue, 25 Jan 2022 02:15:16 UTC

(root@nebula) [(none)]> yield datetime("2011-08-17T11:10:21.570000Z")
+-----------------------------------------+
| datetime("2011-08-17T11:10:21.570000Z") |
+-----------------------------------------+
| BAD_DATA                                |
+-----------------------------------------+
Got 1 rows (time spent 426/1916 us)

Tue, 25 Jan 2022 02:15:31 UTC
(root@nebula) [(none)]> yield datetime("2011-08-17T11:10:21.570+0000")
+------------------------------------------+
| datetime("2011-08-17T11:10:21.570+0000") |
+------------------------------------------+
| BAD_DATA                                 |
+------------------------------------------+
Got 1 rows (time spent 520/2908 us)

Tue, 25 Jan 2022 02:23:03 UTC

@HarrisChu HarrisChu added the type/enhancement Type: make the code neat or more efficient label Jan 25, 2022
@HarrisChu
Copy link
Contributor Author

user cases:

  1. have a big data file with datetime string, e.g. "2011-08-17T11:10:21.570+0000"
  2. cannot import these data into nebula before converting the datetime format.

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Feb 10, 2022

Yes, our current implementation is almost subset of iso8601, we could extend it by following the BNF described in https://datatracker.ietf.org/doc/html/rfc3339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

2 participants