From 81a31abc02796e2d8965842da0de6e9f3e7153b0 Mon Sep 17 00:00:00 2001 From: Hyunsik Choi Date: Mon, 28 Mar 2016 16:32:12 +0900 Subject: [PATCH 1/5] TAJO-2104: Implement Identifier which supports quotation information. --- .../tajo/schema/AnsiSQLIdentifierPolicy.java | 55 ++++++++++++ .../org/apache/tajo/schema/Identifier.java | 73 +++++++++++++++ .../apache/tajo/schema/IdentifierPolicy.java | 90 +++++++++++++++++++ .../tajo/schema/PgSQLIdentifierPolicy.java | 55 ++++++++++++ .../tajo/schema/QualifiedIdentifier.java | 58 ++++++++++++ .../java/org/apache/tajo/schema/Schema.java | 2 +- .../tajo/schema/TajoIdentifierPolicy.java | 29 ++++++ .../schema/TestANSISQLIdentifierPolicy.java | 49 ++++++++++ .../tajo/schema/TestTajoIdentifier.java | 54 +++++++++++ 9 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/Identifier.java create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/PgSQLIdentifierPolicy.java create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java create mode 100644 tajo-common/src/main/java/org/apache/tajo/schema/TajoIdentifierPolicy.java create mode 100644 tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java create mode 100644 tajo-common/src/test/java/org/apache/tajo/schema/TestTajoIdentifier.java diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java new file mode 100644 index 0000000000..c195bb6e9d --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java @@ -0,0 +1,55 @@ +/* + * Lisensed 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.tajo.schema; + +/** + * ANSI SQL Standard Identifier Policy + */ +public class ANSISQLIdentifierPolicy extends IdentifierPolicy { + + @Override + String getName() { + return "ANSI SQL Identifier Policy"; + } + + @Override + public String getIdentifierQuoteString() { + return ANSI_SQL_QUOTE_STRING; + } + + @Override + String getIdentifierSeperator() { + return ANSI_SQL_SEPERATOR_STRING; + } + + @Override + public int getMaxColumnNameLength() { + return MAX_IDENTIFIER_LENGTH; + } + + @Override + IdentifierCase storesUnquotedIdentifierAs() { + return IdentifierCase.UpperCase; + } + + @Override + IdentifierCase storesQuotedIdentifierAs() { + return IdentifierCase.MixedCase; + } +} diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/Identifier.java b/tajo-common/src/main/java/org/apache/tajo/schema/Identifier.java new file mode 100644 index 0000000000..ef4c2bfd3f --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/Identifier.java @@ -0,0 +1,73 @@ +/* + * Lisensed 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.tajo.schema; + +import org.apache.tajo.schema.IdentifierPolicy.IdentifierCase; + +/** + * Identifier Element + */ +public class Identifier { + private String name; + private boolean quoted; + + private Identifier(String name, boolean quoted) { + this.name = name; + this.quoted = quoted; + } + + public static Identifier _(String name) { + return new Identifier(name, false); + } + + public static Identifier _(String name, boolean quoted) { + return new Identifier(name, quoted); + } + + public String displayString(IdentifierPolicy policy) { + StringBuilder sb = new StringBuilder(); + if (quoted) { + appendByCase(sb, policy.storesQuotedIdentifierAs()); + sb.insert(0, policy.getIdentifierQuoteString()); + sb.append(policy.getIdentifierQuoteString()); + } else { + appendByCase(sb, policy.storesUnquotedIdentifierAs()); + } + + return sb.toString(); + } + + private void appendByCase(StringBuilder sb, IdentifierCase c) { + switch (c) { + case LowerCase: + sb.append(name.toLowerCase()); + break; + case UpperCase: + sb.append(name.toUpperCase()); + break; + case MixedCase: + sb.append(name); + break; + } + } + + public String toString() { + return displayString(IdentifierPolicy.DefaultPolicy()); + } +} diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java new file mode 100644 index 0000000000..10eb0ee9ad --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java @@ -0,0 +1,90 @@ +/* + * Lisensed 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.tajo.schema; + +public abstract class IdentifierPolicy { + + /** Quote String */ + public static final String ANSI_SQL_QUOTE_STRING = "'"; + + public static final String ANSI_SQL_SEPERATOR_STRING = "."; + + public final static int MAX_IDENTIFIER_LENGTH = 128; + + public enum IdentifierCase { + LowerCase, + UpperCase, + MixedCase + } + + /** + * Policy name + * + * @return Policy name + */ + abstract String getName(); + + /** + * Retrieves the string used to quote SQL identifiers. This method returns a space " " + * if identifier quoting is not supported. + * + * @return the quoting string or a space if quoting is not supported + */ + abstract String getIdentifierQuoteString(); + + /** + * Retrieves the String that this policy uses as the separator between + * identifiers. + * + * @return the separator string + */ + abstract String getIdentifierSeperator(); + + /** + * Retrieves the maximum number of characters this policy allows for a column name. + * + * @return the maximum number of characters allowed for a column name; + * a result of zero means that there is no limit or the limit is not known + */ + abstract int getMaxColumnNameLength(); + + /** + * Retrieves whether this policy treats unquoted SQL identifiers as + * which case and stores them in which case. + * + * @return IdentifierCase + */ + abstract IdentifierCase storesUnquotedIdentifierAs(); + + /** + * Retrieves whether this policy treats quoted SQL identifiers as + * which case and stores them in which case. + * + * @return IdentifierCase + */ + abstract IdentifierCase storesQuotedIdentifierAs(); + + public static final IdentifierPolicy DefaultPolicy() { + return new TajoIdentifierPolicy(); + } + + public static final IdentifierPolicy ANSISQLPolicy() { + return new ANSISQLIdentifierPolicy(); + } +} diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/PgSQLIdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/PgSQLIdentifierPolicy.java new file mode 100644 index 0000000000..0aca2d7500 --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/PgSQLIdentifierPolicy.java @@ -0,0 +1,55 @@ +/* + * Lisensed 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.tajo.schema; + +/** + * PostgreSQL Identifier Policy + */ +public class PgSQLIdentifierPolicy extends IdentifierPolicy { + + @Override + String getName() { + return "PostgreSQL Identifier Policy"; + } + + @Override + public String getIdentifierQuoteString() { + return ANSI_SQL_QUOTE_STRING; + } + + @Override + String getIdentifierSeperator() { + return ANSI_SQL_SEPERATOR_STRING; + } + + @Override + public int getMaxColumnNameLength() { + return MAX_IDENTIFIER_LENGTH; + } + + @Override + IdentifierCase storesUnquotedIdentifierAs() { + return IdentifierCase.LowerCase; + } + + @Override + IdentifierCase storesQuotedIdentifierAs() { + return IdentifierCase.MixedCase; + } +} diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java new file mode 100644 index 0000000000..13021e5c78 --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java @@ -0,0 +1,58 @@ +/* + * Lisensed 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.tajo.schema; + +import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; +import org.apache.tajo.util.StringUtils; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; + +import static org.apache.tajo.schema.IdentifierPolicy.DefaultPolicy; + +public class QualifiedIdentifier { + private List names; + + private QualifiedIdentifier(ImmutableList names) { + this.names = names; + } + + public String displayString(final IdentifierPolicy policy) { + return StringUtils.join(names, ".", new Function() { + @Override + public String apply(@Nullable Identifier identifier) { + return identifier.displayString(policy); + } + }); + } + + public String toString() { + return displayString(DefaultPolicy()); + } + + public static QualifiedIdentifier QualifiedIdentifier(Collection names) { + return new QualifiedIdentifier(ImmutableList.copyOf(names)); + } + + public static QualifiedIdentifier QualifiedIdentifier(Identifier...names) { + return new QualifiedIdentifier(ImmutableList.copyOf(names)); + } +} diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/Schema.java b/tajo-common/src/main/java/org/apache/tajo/schema/Schema.java index d505062a63..332f622e52 100644 --- a/tajo-common/src/main/java/org/apache/tajo/schema/Schema.java +++ b/tajo-common/src/main/java/org/apache/tajo/schema/Schema.java @@ -52,7 +52,7 @@ public String toString() { } public static NamedStructType Struct(String name, NamedType... namedTypes) { - return new NamedStructType(name, Arrays.asList(namedTypes)); + return Struct(name, Arrays.asList(namedTypes)); } public static NamedStructType Struct(String name, Collection namedTypes) { diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/TajoIdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/TajoIdentifierPolicy.java new file mode 100644 index 0000000000..f74be90c54 --- /dev/null +++ b/tajo-common/src/main/java/org/apache/tajo/schema/TajoIdentifierPolicy.java @@ -0,0 +1,29 @@ +/* + * Lisensed 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.tajo.schema; + +/** + * Tajo Identifier Policy + */ +public class TajoIdentifierPolicy extends PgSQLIdentifierPolicy { + @Override + String getName() { + return "Tajo Identifier Policy"; + } +} diff --git a/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java b/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java new file mode 100644 index 0000000000..c77d27c880 --- /dev/null +++ b/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java @@ -0,0 +1,49 @@ +/* + * Lisensed 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.tajo.schema; + +import org.junit.Test; + +import static org.apache.tajo.schema.Identifier._; +import static org.apache.tajo.schema.IdentifierPolicy.ANSISQLPolicy; +import static org.apache.tajo.schema.IdentifierPolicy.DefaultPolicy; +import static org.apache.tajo.schema.QualifiedIdentifier.QualifiedIdentifier; +import static org.apache.tajo.schema.TestTajoIdentifier.assertIdentifier; +import static org.apache.tajo.schema.TestTajoIdentifier.assertQualifiedIdentifier; + +public class TestANSISQLIdentifierPolicy { + + @Test + public void displayString() throws Exception { + assertIdentifier(ANSISQLPolicy(), _("xyz"), "XYZ"); + assertIdentifier(ANSISQLPolicy(), _("XYZ"), "XYZ"); + + assertIdentifier(ANSISQLPolicy(), _("xyz", true), "'xyz'"); + assertIdentifier(ANSISQLPolicy(), _("xYz", true), "'xYz'"); + } + + @Test + public void testQualifiedIdentifiers() throws Exception { + assertQualifiedIdentifier(ANSISQLPolicy(), QualifiedIdentifier(_("xyz"), _("opq")), "XYZ.OPQ"); + assertQualifiedIdentifier(ANSISQLPolicy(), QualifiedIdentifier(_("XYZ"), _("opq")), "XYZ.OPQ"); + + assertQualifiedIdentifier(ANSISQLPolicy(), QualifiedIdentifier(_("xyz", true), _("opq", false)), "'xyz'.OPQ"); + assertQualifiedIdentifier(ANSISQLPolicy(), QualifiedIdentifier(_("xYz", true), _("opq", true)), "'xYz'.'opq'"); + } +} \ No newline at end of file diff --git a/tajo-common/src/test/java/org/apache/tajo/schema/TestTajoIdentifier.java b/tajo-common/src/test/java/org/apache/tajo/schema/TestTajoIdentifier.java new file mode 100644 index 0000000000..8a52673012 --- /dev/null +++ b/tajo-common/src/test/java/org/apache/tajo/schema/TestTajoIdentifier.java @@ -0,0 +1,54 @@ +/* + * Lisensed 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.tajo.schema; + +import org.junit.Test; + +import static org.apache.tajo.schema.Identifier._; +import static org.apache.tajo.schema.IdentifierPolicy.DefaultPolicy; +import static org.apache.tajo.schema.QualifiedIdentifier.QualifiedIdentifier; +import static org.junit.Assert.assertEquals; + +public class TestTajoIdentifier { + @Test + public void testIdentifiers() throws Exception { + assertIdentifier(DefaultPolicy(), _("xyz"), "xyz"); + assertIdentifier(DefaultPolicy(), _("XYZ"), "xyz"); + + assertIdentifier(DefaultPolicy(), _("xyz", true), "'xyz'"); + assertIdentifier(DefaultPolicy(), _("xYz", true), "'xYz'"); + } + + @Test + public void testQualifiedIdentifiers() throws Exception { + assertQualifiedIdentifier(DefaultPolicy(), QualifiedIdentifier(_("xyz"), _("opq")), "xyz.opq"); + assertQualifiedIdentifier(DefaultPolicy(), QualifiedIdentifier(_("XYZ"), _("opq")), "xyz.opq"); + + assertQualifiedIdentifier(DefaultPolicy(), QualifiedIdentifier(_("xyz", true), _("opq", false)), "'xyz'.opq"); + assertQualifiedIdentifier(DefaultPolicy(), QualifiedIdentifier(_("xYz", true), _("opq", true)), "'xYz'.'opq'"); + } + + public static void assertIdentifier(IdentifierPolicy p, Identifier id, String expected) { + assertEquals(id.displayString(p), expected); + } + + public static void assertQualifiedIdentifier(IdentifierPolicy p, QualifiedIdentifier id, String expected) { + assertEquals(id.displayString(p), expected); + } +} \ No newline at end of file From f0c25306192d827f548ae46ae9d12dcbe2f636c4 Mon Sep 17 00:00:00 2001 From: Hyunsik Choi Date: Mon, 28 Mar 2016 16:48:48 +0900 Subject: [PATCH 2/5] Rename AnsiSQLIdentifierPolicy. --- ...{AnsiSQLIdentifierPolicy.java => ANSISQLIdentifierPolicy.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tajo-common/src/main/java/org/apache/tajo/schema/{AnsiSQLIdentifierPolicy.java => ANSISQLIdentifierPolicy.java} (100%) diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/ANSISQLIdentifierPolicy.java similarity index 100% rename from tajo-common/src/main/java/org/apache/tajo/schema/AnsiSQLIdentifierPolicy.java rename to tajo-common/src/main/java/org/apache/tajo/schema/ANSISQLIdentifierPolicy.java From 5cb0eb9d2cb941672252276ddd04442f284728c9 Mon Sep 17 00:00:00 2001 From: Hyunsik Choi Date: Mon, 28 Mar 2016 17:04:26 +0900 Subject: [PATCH 3/5] Fix QualifiedIdentifier::displayString to use getIdentifierSeperator(). --- .../main/java/org/apache/tajo/schema/QualifiedIdentifier.java | 2 +- .../org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java index 13021e5c78..4a41af3f54 100644 --- a/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java +++ b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java @@ -36,7 +36,7 @@ private QualifiedIdentifier(ImmutableList names) { } public String displayString(final IdentifierPolicy policy) { - return StringUtils.join(names, ".", new Function() { + return StringUtils.join(names, policy.getIdentifierSeperator(), new Function() { @Override public String apply(@Nullable Identifier identifier) { return identifier.displayString(policy); diff --git a/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java b/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java index c77d27c880..9643a8954d 100644 --- a/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java +++ b/tajo-common/src/test/java/org/apache/tajo/schema/TestANSISQLIdentifierPolicy.java @@ -22,7 +22,6 @@ import static org.apache.tajo.schema.Identifier._; import static org.apache.tajo.schema.IdentifierPolicy.ANSISQLPolicy; -import static org.apache.tajo.schema.IdentifierPolicy.DefaultPolicy; import static org.apache.tajo.schema.QualifiedIdentifier.QualifiedIdentifier; import static org.apache.tajo.schema.TestTajoIdentifier.assertIdentifier; import static org.apache.tajo.schema.TestTajoIdentifier.assertQualifiedIdentifier; From aab34383f85ae910d4a80e5199355518b7691b6b Mon Sep 17 00:00:00 2001 From: Hyunsik Choi Date: Mon, 28 Mar 2016 17:07:54 +0900 Subject: [PATCH 4/5] Change List to ImmutableList. --- .../main/java/org/apache/tajo/schema/QualifiedIdentifier.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java index 4a41af3f54..6f00ee9e6f 100644 --- a/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java +++ b/tajo-common/src/main/java/org/apache/tajo/schema/QualifiedIdentifier.java @@ -24,12 +24,11 @@ import javax.annotation.Nullable; import java.util.Collection; -import java.util.List; import static org.apache.tajo.schema.IdentifierPolicy.DefaultPolicy; public class QualifiedIdentifier { - private List names; + private ImmutableList names; private QualifiedIdentifier(ImmutableList names) { this.names = names; From 2c13f3cb599c594fb788143b2d33a388dd99596a Mon Sep 17 00:00:00 2001 From: Hyunsik Choi Date: Mon, 28 Mar 2016 17:09:12 +0900 Subject: [PATCH 5/5] Add some comment to IdentifierPolicy. --- .../src/main/java/org/apache/tajo/schema/IdentifierPolicy.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java b/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java index 10eb0ee9ad..526d7a94c2 100644 --- a/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java +++ b/tajo-common/src/main/java/org/apache/tajo/schema/IdentifierPolicy.java @@ -18,6 +18,9 @@ package org.apache.tajo.schema; +/** + * Policy to describe how to deal identifiers + */ public abstract class IdentifierPolicy { /** Quote String */