alpass163 commented on code in PR #17102:
URL: https://github.com/apache/iotdb/pull/17102#discussion_r2740391523
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/ExpressionAnalyzer.java:
##########
@@ -1132,6 +1170,65 @@ public List<Type> getCallArgumentTypes(
return argumentTypesBuilder.build();
}
+ private void addTimeArgument(List<Expression> arguments, String
actualTimeField) {
+
+ if (arguments.get(0) instanceof DereferenceExpression) {
+ arguments.add(
+ new DereferenceExpression(
+ ((DereferenceExpression) arguments.get(0)).getBase(),
+ new Identifier(actualTimeField.toLowerCase(Locale.ENGLISH))));
+ } else {
+ arguments.add(new
Identifier(actualTimeField.toLowerCase(Locale.ENGLISH)));
+ }
+ }
+
+ private boolean checkArgumentIsTimestamp(Expression argument, List<Field>
visibleFields) {
+
+ String argumentName =
+ (argument instanceof DereferenceExpression)
+ ? ((DereferenceExpression) argument)
+ .getField()
+ .orElseThrow(() -> new SemanticException("the input field do
not exists"))
+ .toString()
+ : argument.toString();
+
+ for (Field field : visibleFields) {
+ if (field
+ .getName()
+ .orElseThrow(() -> new SemanticException("the field in table do
not hava the name"))
+ .equalsIgnoreCase(argumentName)) {
+ return field.getType() == TIMESTAMP;
+ }
+ }
+ // should never reach here
+ throw new SemanticException("the input argument do not exists");
Review Comment:
fixed it
--
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]