kasakrisz commented on code in PR #4344: URL: https://github.com/apache/hive/pull/4344#discussion_r1214333904
########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/AstBuilder.java: ########## @@ -0,0 +1,266 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.metastore.parser; + +import java.sql.Date; +import java.sql.Timestamp; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; +import java.util.stream.Collectors; + +import org.antlr.v4.runtime.misc.ParseCancellationException; +import org.antlr.v4.runtime.tree.RuleNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +import static org.apache.hadoop.hive.metastore.parser.ExpressionTree.LeafNode; +import static org.apache.hadoop.hive.metastore.parser.ExpressionTree.LogicalOperator; +import static org.apache.hadoop.hive.metastore.parser.ExpressionTree.Operator; +import static org.apache.hadoop.hive.metastore.parser.ExpressionTree.TreeNode; + +public class AstBuilder extends PartitionFilterBaseVisitor<Object> { + private final DateTimeFormatter dateFormat = + DateTimeFormatter.ofPattern("yyyy-MM-dd") + .withZone(TimeZone.getTimeZone("UTC").toZoneId()); + private final DateTimeFormatter timestampFormat = + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + .withZone(TimeZone.getTimeZone("UTC").toZoneId()); Review Comment: Please change the `ResolverStyle` to `STRICT` as @zabetak pointed out that Hive use it other places too. You also have to change the format to `uuuu-MM-dd` -- 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]
