Hisoka-X commented on code in PR #9342:
URL: https://github.com/apache/seatunnel/pull/9342#discussion_r2101570787


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/sql/zeta/ZetaSQLFunction.java:
##########
@@ -334,7 +336,18 @@ public Object computeForValue(Expression expression, 
Object[] inputFields) {
         if (expression instanceof ExtractExpression) {
             ExtractExpression extract = (ExtractExpression) expression;
             List<Object> functionArgs = new ArrayList<>();
-            functionArgs.add(computeForValue(extract.getExpression(), 
inputFields));
+            if (extract.getExpression() instanceof DateTimeLiteralExpression) {
+                DateTimeLiteralExpression dateTimeLiteralExpression =
+                        (DateTimeLiteralExpression) extract.getExpression();
+                String value = dateTimeLiteralExpression.getValue();
+                if (value.startsWith("'") && value.endsWith("'")) {
+                    value = value.substring(1, value.length() - 1);
+                }
+                functionArgs.add(LocalDateTime.parse(value));

Review Comment:
   move it to `computeForValue`



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

Reply via email to