From a3411b42f20008884dbf375b9bbd43e395c48b0d Mon Sep 17 00:00:00 2001 From: 924060929 <924060929@qq.com> Date: Wed, 30 Oct 2024 23:08:38 +0800 Subject: [PATCH] fix checkstyle --- .../expressions/literal/DateLiteral.java | 22 +++-- .../expressions/literal/DateTimeLiteral.java | 1 + .../expressions/literal/FloatLiteral.java | 38 -------- .../literal/IntegerLikeLiteral.java | 28 ------ .../literal/format/AndChecker.java | 18 ++++ .../literal/format/AtLeastChecker.java | 1 + .../literal/format/CharChecker.java | 18 ++++ .../literal/format/CustomCharChecker.java | 19 +++- .../literal/format/DateTimeChecker.java | 96 +++++++++++-------- .../literal/format/FloatChecker.java | 46 ++++++--- .../literal/format/FormatChecker.java | 1 + .../literal/format/IntegerChecker.java | 18 ++++ .../literal/format/NumberChecker.java | 1 + .../literal/format/OptionChecker.java | 18 ++++ .../expressions/literal/format/OrChecker.java | 18 ++++ .../literal/format/StringChecker.java | 18 ++++ .../literal/format/StringInspect.java | 20 +++- 17 files changed, 253 insertions(+), 128 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateLiteral.java index a30e006a7172f3..187eba21d6d271 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateLiteral.java @@ -44,6 +44,10 @@ public class DateLiteral extends Literal { public static final String JAVA_DATE_FORMAT = "yyyy-MM-dd"; + public static final Set punctuations = ImmutableSet.of('!', '@', '#', '$', '%', '^', '&', '*', '(', ')', + '-', '+', '=', '_', '{', '}', '[', ']', '|', '\\', ':', ';', '"', '\'', '<', '>', ',', '.', '?', '/', '~', + '`'); + // for cast datetime type to date type. private static final LocalDateTime START_OF_A_DAY = LocalDateTime.of(0, 1, 1, 0, 0, 0); private static final LocalDateTime END_OF_A_DAY = LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999999000); @@ -51,10 +55,6 @@ public class DateLiteral extends Literal { private static final DateLiteral MAX_DATE = new DateLiteral(9999, 12, 31); private static final int[] DAYS_IN_MONTH = new int[] {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - public static final Set punctuations = ImmutableSet.of('!', '@', '#', '$', '%', '^', '&', '*', '(', ')', - '-', '+', '=', '_', '{', '}', '[', ']', '|', '\\', ':', ';', '"', '\'', '<', '>', ',', '.', '?', '/', '~', - '`'); - protected long year; protected long month; protected long day; @@ -209,7 +209,9 @@ static Result normalize(String s) { } } else { final String currentString = s; - return Result.err(() -> new AnalysisException("date/datetime literal [" + currentString + "] is invalid")); + return Result.err( + () -> new AnalysisException("date/datetime literal [" + currentString + "] is invalid") + ); } i = j; partNumber += 1; @@ -230,7 +232,9 @@ static Result normalize(String s) { sb.append(':'); } else { final String currentString = s; - return Result.err(() -> new AnalysisException("date/datetime literal [" + currentString + "] is invalid")); + return Result.err( + () -> new AnalysisException("date/datetime literal [" + currentString + "] is invalid") + ); } } else { break; @@ -264,6 +268,7 @@ static Result normalize(String s) { return Result.ok(sb.toString()); } + /** parseDateLiteral */ public static Result parseDateLiteral(String s) { Result parseResult = parseDateTime(s); if (parseResult.isError()) { @@ -280,6 +285,7 @@ public static Result parseDateLiteral(String s) return Result.ok(new DateLiteral(year, month, day)); } + /** parseDateTime */ public static Result parseDateTime(String s) { // fast parse '2022-01-01' if (s.length() == 10 && s.charAt(4) == '-' && s.charAt(7) == '-') { @@ -336,7 +342,9 @@ public static Result parseDateTime(String s // if Year is not present, throw exception if (!dateTime.isSupported(ChronoField.YEAR)) { - return Result.err(() -> new AnalysisException("date/datetime literal [" + originalString + "] is invalid")); + return Result.err( + () -> new AnalysisException("date/datetime literal [" + originalString + "] is invalid") + ); } return Result.ok(dateTime); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateTimeLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateTimeLiteral.java index 84dc151a5a61d9..7ddee0c0e845eb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateTimeLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/DateTimeLiteral.java @@ -130,6 +130,7 @@ public static int determineScale(String s) { return scale; } + /** parseDateTimeLiteral */ public static Result parseDateTimeLiteral(String s, boolean isV2) { Result parseResult = parseDateTime(s); if (parseResult.isError()) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/FloatLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/FloatLiteral.java index 94fdc3655bfd17..df75bbcfc5c440 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/FloatLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/FloatLiteral.java @@ -48,42 +48,4 @@ public R accept(ExpressionVisitor visitor, C context) { public LiteralExpr toLegacyLiteral() { return new org.apache.doris.analysis.FloatLiteral(getDouble(), Type.FLOAT); } - - public static boolean isValidFloat(String str) { - if (str == null || str.isEmpty()) { - return true; - } - - int index = 0; - char c = str.charAt(index); - if (c == '+' || c == '-') { - index++; - } - - while (index < str.length()) { - c = str.charAt(index++); - if (c == 'E' || c == '.') { - break; - } - if (!Character.isDigit(c)) { - return false; - } - } - - for (; index < str.length(); index++) { - c = str.charAt(index); - if (!('0' <= c && c <= '9')) { - return false; - } - } - return true; - } - - // private boolean parseIntegerParts(String str, int index) { - // int index = 0; - // char c = str.charAt(index); - // if (c == '+' || c == '-') { - // index++; - // } - // } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/IntegerLikeLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/IntegerLikeLiteral.java index b087fb266de511..54456bd9493564 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/IntegerLikeLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/IntegerLikeLiteral.java @@ -39,32 +39,4 @@ public long getLongValue() { } public abstract Number getNumber(); - - public static boolean isValidInteger(String str) { - if (str == null || str.isEmpty()) { - return true; - } - - int index = 0; - - char c = str.charAt(index); - if (c == '+' || c == '-') { - index++; - } - - for (; index < str.length(); index++) { - c = str.charAt(index); - if (!('0' <= c && c <= '9')) { - return false; - } - } - return true; - } - - public static void main(String[] args) { - System.out.println(isValidInteger("01")); - System.out.println(isValidInteger("+01")); - System.out.println(isValidInteger("-01")); - System.out.println(isValidInteger("- 01")); - } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AndChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AndChecker.java index 7f4080f623ae61..b13dff956ae3c2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AndChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AndChecker.java @@ -1,7 +1,25 @@ +// 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.doris.nereids.trees.expressions.literal.format; import java.util.List; +/** AndChecker */ public class AndChecker extends FormatChecker { private final List checkers; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AtLeastChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AtLeastChecker.java index 25e4c714860e7a..34fca52d58f7de 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AtLeastChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/AtLeastChecker.java @@ -19,6 +19,7 @@ import java.util.function.Predicate; +/** AtLeastChecker */ public class AtLeastChecker extends FormatChecker { private int minCount; private int maxRead; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CharChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CharChecker.java index 00936c69c66f3f..1a3ab542b3e8b5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CharChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CharChecker.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** CharChecker */ public class CharChecker extends FormatChecker { public final char c; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CustomCharChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CustomCharChecker.java index d0ca1bf7675041..3d9f116cf8a9d4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CustomCharChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/CustomCharChecker.java @@ -1,8 +1,25 @@ -package org.apache.doris.nereids.trees.expressions.literal.format; +// 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.doris.nereids.trees.expressions.literal.format; import java.util.function.Predicate; +/** CustomCharChecker */ public class CustomCharChecker extends FormatChecker { private Predicate checker; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/DateTimeChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/DateTimeChecker.java index af77609bb5ac49..b0c1e15b2f11da 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/DateTimeChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/DateTimeChecker.java @@ -1,7 +1,25 @@ +// 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.doris.nereids.trees.expressions.literal.format; import org.apache.doris.nereids.trees.expressions.literal.DateLiteral; +/** DateTimeChecker */ public class DateTimeChecker extends FormatChecker { private DateTimeChecker(StringInspect stringInspect) { super(stringInspect); @@ -15,47 +33,47 @@ public static boolean isValidDateTime(String str) { @Override protected boolean doCheck() { FormatChecker dateFormatChecker = and( - or( - // date - and( - or( - // 20241012 - number(8, 8), - // 2024-10-12 - and( - number(4, 4), // year - chars(DateLiteral.punctuations::contains), - number(2, 2), // month - chars(DateLiteral.punctuations::contains), - number(2, 2) // day - ) - ), - option(ch('Z')) - ), - // datetime - and( - or( - // 20241012010203 - number(14, 14), - // 2024-01-01 01:02:03 - and( - number(4, 4), // year - chars(DateLiteral.punctuations::contains), - number(2, 2), // month - chars(DateLiteral.punctuations::contains), - number(2, 2), // day - atLeast(1, c -> c == 'T' || c == ' ' || DateLiteral.punctuations.contains(c)), - number(2, 2), // hour - chars(DateLiteral.punctuations::contains), - number(2, 2), // minute - chars(DateLiteral.punctuations::contains), - number(2, 2) // second - ) + or( + // date + and( + or( + // 20241012 + number(8, 8), + // 2024-10-12 + and( + number(4, 4), // year + chars(DateLiteral.punctuations::contains), + number(2, 2), // month + chars(DateLiteral.punctuations::contains), + number(2, 2) // day + ) + ), + option(ch('Z')) ), - option(nanoSecond()), - option(timeZone()) + // datetime + and( + or( + // 20241012010203 + number(14, 14), + // 2024-01-01 01:02:03 + and( + number(4, 4), // year + chars(DateLiteral.punctuations::contains), + number(2, 2), // month + chars(DateLiteral.punctuations::contains), + number(2, 2), // day + atLeast(1, c -> c == 'T' || c == ' ' || DateLiteral.punctuations.contains(c)), + number(2, 2), // hour + chars(DateLiteral.punctuations::contains), + number(2, 2), // minute + chars(DateLiteral.punctuations::contains), + number(2, 2) // second + ) + ), + option(nanoSecond()), + option(timeZone()) + ) ) - ) ); return dateFormatChecker.check(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FloatChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FloatChecker.java index 48623a51a3f0dd..98d539f7a74548 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FloatChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FloatChecker.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** FloatChecker */ public class FloatChecker extends FormatChecker { private FloatChecker(StringInspect stringInspect) { super(stringInspect); @@ -12,21 +30,21 @@ public static boolean isValidFloat(String str) { @Override protected boolean doCheck() { FormatChecker floatFormatChecker = and( - option(chars(c -> c == '+' || c == '-')), - or( - // 123 or 123.456 - and(number(1), option(and(ch('.'), number(0)))), - // .123 - and(ch('.'), number(1)) - ), - option( - // E+10 or E-10 or E10 - and( - ch('E'), - option(chars(c -> c == '+' || c == '-')), - number(1) + option(chars(c -> c == '+' || c == '-')), + or( + // 123 or 123.456 + and(number(1), option(and(ch('.'), number(0)))), + // .123 + and(ch('.'), number(1)) + ), + option( + // E+10 or E-10 or E10 + and( + ch('E'), + option(chars(c -> c == '+' || c == '-')), + number(1) + ) ) - ) ); return floatFormatChecker.check() && stringInspect.eos(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FormatChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FormatChecker.java index e17fbe7accca58..4130c2e7f95d5d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FormatChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/FormatChecker.java @@ -21,6 +21,7 @@ import java.util.function.Predicate; +/** FormatChecker */ public abstract class FormatChecker { protected final StringInspect stringInspect; protected int checkStartIndex; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/IntegerChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/IntegerChecker.java index 29322c6dae40b8..ead49de0eec43d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/IntegerChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/IntegerChecker.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** IntegerChecker */ public class IntegerChecker extends FormatChecker { private IntegerChecker(StringInspect stringInspect) { super(stringInspect); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/NumberChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/NumberChecker.java index 3f3a6a3a016b72..19ba2906649bb6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/NumberChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/NumberChecker.java @@ -17,6 +17,7 @@ package org.apache.doris.nereids.trees.expressions.literal.format; +/** NumberChecker */ public class NumberChecker extends FormatChecker { private int minCount; private int maxRead; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OptionChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OptionChecker.java index a9ba56f23748f9..c97eb54b8c0322 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OptionChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OptionChecker.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** OptionChecker */ public class OptionChecker extends FormatChecker { private final FormatChecker checker; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OrChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OrChecker.java index 4b05cd8b137f43..ffdab3b8001f2c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OrChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/OrChecker.java @@ -1,7 +1,25 @@ +// 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.doris.nereids.trees.expressions.literal.format; import java.util.List; +/** OrChecker */ public class OrChecker extends FormatChecker { private final List checkers; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringChecker.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringChecker.java index ac9f967a311ccf..fa2fae23e40044 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringChecker.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringChecker.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** StringChecker */ public class StringChecker extends FormatChecker { private String str; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringInspect.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringInspect.java index 1b0a72c09c8990..cc66e4db866233 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringInspect.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/format/StringInspect.java @@ -1,5 +1,23 @@ +// 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.doris.nereids.trees.expressions.literal.format; +/** StringInspect */ public class StringInspect { public final String str; private int index; @@ -15,7 +33,7 @@ public boolean eos() { public int remain() { return str.length() - index; } - + public char lookAt() { return str.charAt(index); }