nebula
nebula copied to clipboard
Support for adding built-in transformations in the date function timestamp
日期转换函数timpstamp插入和保存都是int64,后面是否会支持yyyy-MM-dd HH:mm:ss这种形式,同时支持内部日期函数转换,将int64转换成yyyy-MM-dd HH:mm:ss。对于int64,现在的解决措施只能是应用内转换和新建string字段展示正常的日期格式
Dear @wx-123456 ,
For the insert, it can take a string like this:
INSERT VERTEX school(name, found_time) VALUES "DUT":("DUT", timestamp("1988-03-01T08:00:00"));
While for return/yield, maybe a function to convert int64 into a string would be with better experience to save the application from converting/displaying DateTime props.
What do you think @CPWstatic, please?
Thanks a lot for raising this!
后面是否会支持yyyy-MM-dd HH:mm:ss这种形式
For this part, you could try Date or DateTime.
将int64转换成yyyy-MM-dd HH:mm:ss
This would be considered as function.
Maybe I can try to fix it.
@CPWstatic Is this issue still valid?
Maybe I can try to fix it.
Thanks very much. Try it.
Maybe I can try to fix it.
Already assigned it to you.
Insert
Insert timestamp is supported at present, so we can ignore insert.
store
It isn't good idea that timestamp store as String in special format .
return/show
Naturally, we will try to return/show timestamp as String in special format through a function.
But it is troublesome that because the type is lost.
In the FunctionManager.cpp, we can see that there isn't type timestamp . In the end of request, we will just get List<Row<Int>> from Response, we can't distinguish between Int and Int from timestamp() .
I think it isn't wise that add a new type or modify many code due to this demand.
store It isn't good idea that timestamp store as String in special format .
True, it should only be a handy function(rather than introducing any new types) to take non-int format data to save user from constructing datatime in int type themself. Underlying it should be stored as existing datatime type(int).
Consider this
toDate(int)
date(int)
Hi, I’m Artem from OSS Revival. And I am already working on this issue.