felipepessoto commented on code in PR #12967:
URL: https://github.com/apache/gluten/pull/12967#discussion_r3954120668
##########
cpp/velox/substrait/VeloxSubstraitSignature.cc:
##########
@@ -24,6 +24,9 @@ std::string
VeloxSubstraitSignature::toSubstraitSignature(const TypePtr& type) {
if (type->isDate()) {
return "date";
}
+ if (type->equivalent(*TIMESTAMP_UTC())) {
+ return "tsntz";
Review Comment:
`ts_ntz` would align visually with Spark, but it cannot represent one type
in Gluten's current function-signature grammar. The native parser uses `_` as
the delimiter between argument types
([parser](https://github.com/apache/gluten/blob/6f80ab9cf4eac841c23c1ea4af4e2b3fb5f66e94/cpp/velox/substrait/SubstraitParser.cc#L236-L261)),
so `min:ts_ntz` is parsed as two argument types, `ts` and `ntz`, and aggregate
validation fails when it tries to resolve `ntz`.
`tsntz` is deliberately an internal, separator-free signature token
([mapping](https://github.com/apache/gluten/blob/6f80ab9cf4eac841c23c1ea4af4e2b3fb5f66e94/gluten-substrait/src/main/scala/org/apache/gluten/expression/ConverterUtils.scala#L405-L419)).
The Spark-facing type remains `timestamp_ntz`, and the Substrait
representation remains `PrecisionTimestamp`. Using `ts_ntz` would require first
changing the signature grammar to support escaping or structured type tokens.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]