From 9822261edfdc082f2e1d87fd6e5287db5c023ead Mon Sep 17 00:00:00 2001 From: takezoe Date: Sat, 2 Mar 2024 13:21:15 +0900 Subject: [PATCH] Add constructor of RenameColumn without NodeLocation --- .../main/java/io/trino/sql/tree/RenameColumn.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/trino-parser/src/main/java/io/trino/sql/tree/RenameColumn.java b/core/trino-parser/src/main/java/io/trino/sql/tree/RenameColumn.java index e6f9283569fc1..581b12ca61d68 100644 --- a/core/trino-parser/src/main/java/io/trino/sql/tree/RenameColumn.java +++ b/core/trino-parser/src/main/java/io/trino/sql/tree/RenameColumn.java @@ -31,9 +31,19 @@ public class RenameColumn private final boolean tableExists; private final boolean columnExists; + public RenameColumn(QualifiedName table, QualifiedName source, Identifier target, boolean tableExists, boolean columnExists) + { + this(Optional.empty(), table, source, target, tableExists, columnExists); + } + public RenameColumn(NodeLocation location, QualifiedName table, QualifiedName source, Identifier target, boolean tableExists, boolean columnExists) { - super(Optional.of(location)); + this(Optional.of(location), table, source, target, tableExists, columnExists); + } + + private RenameColumn(Optional location, QualifiedName table, QualifiedName source, Identifier target, boolean tableExists, boolean columnExists) + { + super(location); this.table = requireNonNull(table, "table is null"); this.source = requireNonNull(source, "source is null"); this.target = requireNonNull(target, "target is null");