Returns a TimestampVal representation in the output variable. Returns null if the TimestampValue instance doesn't have a valid date or time.
| 153 | /// Returns a TimestampVal representation in the output variable. |
| 154 | /// Returns null if the TimestampValue instance doesn't have a valid date or time. |
| 155 | void ToTimestampVal(impala_udf::TimestampVal* tv) const { |
| 156 | if (!HasDate()) { |
| 157 | tv->is_null = true; |
| 158 | return; |
| 159 | } |
| 160 | memcpy(&tv->date, &date_, sizeof(date_)); |
| 161 | memcpy(&tv->time_of_day, &time_, sizeof(time_)); |
| 162 | tv->is_null = false; |
| 163 | } |
| 164 | |
| 165 | void ToPtime(boost::posix_time::ptime* ptp) const { |
| 166 | *ptp = boost::posix_time::ptime(date_, time_); |
no outgoing calls