From 07561a4471f97e6f8fdea8e126a05f53111c619b Mon Sep 17 00:00:00 2001 From: 924060929 Date: Tue, 26 Nov 2024 21:12:04 +0800 Subject: [PATCH] fix --- .../expressions/literal/DateLiteral.java | 28 +++++++++---------- .../insert/InsertIntoTableCommand.java | 3 +- 2 files changed, 16 insertions(+), 15 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 2e2594469a091ab..87ebfceb8c2d9e6 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 @@ -287,23 +287,23 @@ public static Result parseDateLiteral(String s) /** parseDateTime */ public static Result parseDateTime(String s) { - // fast parse '2022-01-01' - if ((s.length() == 10 || s.length() == 19) && s.charAt(4) == '-' && s.charAt(7) == '-') { - if (s.length() == 10) { - TemporalAccessor date = fastParseDate(s); - if (date != null) { - return Result.ok(date); - } - } else if (s.charAt(10) == ' ' && s.charAt(13) == ':' && s.charAt(16) == ':') { - TemporalAccessor date = fastParseDateTime(s); - if (date != null) { - return Result.ok(date); + String originalString = s; + try { + // fast parse '2022-01-01' + if ((s.length() == 10 || s.length() == 19) && s.charAt(4) == '-' && s.charAt(7) == '-') { + if (s.length() == 10) { + TemporalAccessor date = fastParseDate(s); + if (date != null) { + return Result.ok(date); + } + } else if (s.charAt(10) == ' ' && s.charAt(13) == ':' && s.charAt(16) == ':') { + TemporalAccessor date = fastParseDateTime(s); + if (date != null) { + return Result.ok(date); + } } } - } - String originalString = s; - try { TemporalAccessor dateTime; // remove suffix/prefix ' ' diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java index bdb7eb573fd55da..9bc083f9f8a49f6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java @@ -497,7 +497,8 @@ public Plan visitLogicalInlineTable(LogicalInlineTable logicalInlineTable, Void logicalInlineTable = (LogicalInlineTable) super.visitLogicalInlineTable(logicalInlineTable, context); return new LogicalUnion( - Qualifier.ALL, logicalInlineTable.getConstantExprsList(), ImmutableList.of() + Qualifier.ALL, logicalInlineTable.getConstantExprsList().get(0), + ImmutableList.of(), logicalInlineTable.getConstantExprsList(), false, ImmutableList.of() ); } };