[GLUTEN-7589][VL] Support date_trunc function#7611
Conversation
|
Run Gluten Clickhouse CI |
1 similar comment
|
Run Gluten Clickhouse CI |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR was auto-closed because it has been stalled for 10 days with no activity. Please feel free to reopen if it is still valid. Thanks. |
|
@zml1206 Do you plan to reopen this to support date_trunc function in gluten? |
After this PR(facebookincubator/velox#11340) is merged, I will open a new PR to support it. |
| } | ||
| } | ||
|
|
||
| test("date_trunc") { |
There was a problem hiding this comment.
@zml1206 I was running part of this test by using your velox changes and it was giving incorrect result for year
Output for this 2015-07-22 10:01:40.123456 was coming to be 2014-12-31 16:00:00.0 instead of 2015-01-01 00:00:00.0
It may be due to timezone conversion, could you suggest if I am missing something?
There was a problem hiding this comment.
withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> "UTC")
There was a problem hiding this comment.
I had tried setting this and it gives correct results but I was confused that for a real workload also do we need to set it? Will setting of this config not be needed if we pass timezone also to this function?
From velox side I see that in call method of this function, timeZone_ comes out to be a nullptr, but gluten passes spark.sql.session.timeZone to velox as query config so I am confused as to why it comes to be a nullptr? Could you please share light on it as I am new to the timestamp part.
There was a problem hiding this comment.
There was a problem hiding this comment.
Here it comes to be nullptr when I added a logline to prine timezone, that's what caused the confusion.
There was a problem hiding this comment.
Thanks, then it seems some issue in my environment due to which it comes out to be null.
There was a problem hiding this comment.
For me initialize function was never getting called when I was running test from gluten, after changing the definition of initialize to this it is working fine.
FOLLY_ALWAYS_INLINE void initialize(
const std::vector& /inputTypes/,
const core::QueryConfig& config,
const arg_type* /unitString/,
const arg_type* /timestamp/) {
std::cout << "Initializing DateTruncFunction" << std::endl;
timeZone_ = getTimeZoneFromConfig(config);
}
There was a problem hiding this comment.
Oh, my mistake, thank you.
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |

What changes were proposed in this pull request?
Fixes: #7589
How was this patch tested?