Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Dec 5, 2024
1 parent bd0ea3b commit 07561a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,23 +287,23 @@ public static Result<DateLiteral, AnalysisException> parseDateLiteral(String s)

/** parseDateTime */
public static Result<TemporalAccessor, AnalysisException> 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 ' '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
};
Expand Down

0 comments on commit 07561a4

Please sign in to comment.