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

Time zone related be function #1598

Merged
merged 5 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/common/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include "exprs/utility_functions.h"
#include "exprs/json_functions.h"
#include "exprs/hll_hash_function.h"
#include "exprs/timezone_db.h"
#include "geo/geo_functions.h"
#include "olap/options.h"
#include "util/time.h"
Expand Down Expand Up @@ -268,6 +269,7 @@ void init_daemon(int argc, char** argv, const std::vector<StorePath>& paths) {
HllHashFunctions::init();
ESFunctions::init();
GeoFunctions::init();
TimezoneDatabase::init();

pthread_t tc_malloc_pid;
pthread_create(&tc_malloc_pid, NULL, tcmalloc_gc_thread, NULL);
Expand Down
2 changes: 1 addition & 1 deletion be/src/exec/es/es_scroll_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Status ScrollParser::fill_tuple(const TupleDescriptor* tuple_desc,
case TYPE_DATE:
case TYPE_DATETIME: {
if (col.IsNumber()) {
if (!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.GetInt64())) {
if (!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.GetInt64(), "+08:00")) {
return Status::InternalError(strings::Substitute(ERROR_INVALID_COL_DATA, type_to_string(type)));
}

Expand Down
4 changes: 2 additions & 2 deletions be/src/exec/es_scan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,14 +846,14 @@ Status EsScanNode::materialize_row(MemPool* tuple_pool, Tuple* tuple,
break;
case TYPE_DATE:
if (val_idx >= col.long_vals.size() ||
!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.long_vals[val_idx])) {
!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.long_vals[val_idx], "+08:00")) {
return Status::InternalError(strings::Substitute(ERROR_INVALID_COL_DATA, "TYPE_DATE"));
}
reinterpret_cast<DateTimeValue*>(slot)->cast_to_date();
break;
case TYPE_DATETIME: {
if (val_idx >= col.long_vals.size() ||
!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.long_vals[val_idx])) {
!reinterpret_cast<DateTimeValue*>(slot)->from_unixtime(col.long_vals[val_idx], "+08:00")) {
return Status::InternalError(strings::Substitute(ERROR_INVALID_COL_DATA, "TYPE_DATETIME"));
}
reinterpret_cast<DateTimeValue*>(slot)->set_type(TIME_DATETIME);
Expand Down
Loading