rui-mo commented on code in PR #13041:
URL: https://github.com/apache/gluten/pull/13041#discussion_r4471535139


##########
cpp/velox/substrait/VeloxToSubstraitExpr.cc:
##########
@@ -99,9 +99,45 @@ const ::substrait::Expression_Literal& 
toSubstraitNullLiteral(
   return *substraitField;
 }
 
+const ::substrait::Expression_Literal& toSubstraitNullLiteral(
+    google::protobuf::Arena& arena,
+    const velox::TypePtr& type) {
+  auto nestedType = type;
+  while (nestedType->isArray()) {
+    nestedType = nestedType->asArray().elementType();
+  }
+  // Preserve physical-kind encoding for non-timestamp nulls.
+  if (nestedType->kind() != TypeKind::TIMESTAMP) {
+    return toSubstraitNullLiteral(arena, type->kind());
+  }
+  ::substrait::Expression_Literal* substraitField =

Review Comment:
   Is there a particular reason why a null literal of type `Timestamp` cannot 
be handled by the existing `toSubstraitNullLiteral` function?
   ```
   const ::substrait::Expression_Literal& toSubstraitNullLiteral(
       google::protobuf::Arena& arena,
       const velox::TypeKind& typeKind)
   ```
   



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