Copilot commented on code in PR #12967:
URL: https://github.com/apache/gluten/pull/12967#discussion_r4029736350


##########
cpp/velox/substrait/VeloxToSubstraitType.cc:
##########
@@ -31,6 +31,14 @@ const ::substrait::Type& 
VeloxToSubstraitTypeConvertor::toSubstraitType(
     substraitType->set_allocated_date(substraitDate);
     return *substraitType;
   }
+  if (type->equivalent(*velox::TIMESTAMP_UTC())) {
+    auto substraitPrecisionTimestamp =
+        
google::protobuf::Arena::CreateMessage<::substrait::Type_PrecisionTimestamp>(&arena);
+    substraitPrecisionTimestamp->set_precision(6);
+    
substraitPrecisionTimestamp->set_nullability(::substrait::Type_Nullability_NULLABILITY_NULLABLE);

Review Comment:
   This adds the `PrecisionTimestamp` type mapping, but timestamp literals 
still go through `VeloxToSubstraitExpr`'s `TypeKind::TIMESTAMP` path, which 
emits `timestamp_tz`; parsing that literal reconstructs `TIMESTAMP()`, not 
`TIMESTAMP_UTC()`. A plan containing a TIMESTAMP_NTZ literal can therefore lose 
its logical type during round-trip (and fail or change semantics in mixed NTZ 
operations). Pass the logical type into literal conversion and emit the NTZ 
literal form, with a regression test for a literal/Values plan.



-- 
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]

Reply via email to