calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [23/58] [abbrv] [partial] incubator-calcite git commit: [CALCITE-306] Standardize code style for "import package.*; "
Date Fri, 14 Nov 2014 21:32:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java
index c4b560d..c7eebd8 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java
@@ -14,16 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.List;
-
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.parser.*;
-import org.eigenbase.util.Util;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.util.Util;
 
 import com.google.common.collect.ImmutableList;
 
+import java.util.List;
+
 /**
  * A generic implementation of {@link SqlMoniker}.
  */

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerType.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerType.java
index 6487992..4b64859 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerType.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerType.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
 /**
  * An enumeration of moniker types.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlMonotonicity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonotonicity.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonotonicity.java
index 0d78517..778b38d 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonotonicity.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonotonicity.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
 /**
  * Enumeration of types of monotonicity.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java
index 6af94b6..eca367b 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java
@@ -14,12 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.*;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.util.SqlShuttle;
+import org.apache.calcite.sql.util.SqlVisitor;
 
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.util.*;
+import java.util.Stack;
 
 /**
  * Refinement to {@link SqlShuttle} which maintains a stack of scopes.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
index acc5836..6994e97 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java
@@ -14,21 +14,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.List;
-
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.type.*;
-import org.eigenbase.util.Util;
-
-import net.hydromatic.optiq.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.schema.AggregateFunction;
+import org.apache.calcite.schema.FunctionParameter;
+import org.apache.calcite.sql.SqlAggFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlReturnTypeInference;
+import org.apache.calcite.util.Util;
 
 import com.google.common.base.Function;
 import com.google.common.collect.Lists;
 
+import java.util.List;
+
 /**
  * User-defined aggregate function.
  *

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
index fc9d771..49960f1 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java
@@ -14,16 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.List;
-
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.type.*;
-import org.eigenbase.util.Util;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.schema.Function;
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlReturnTypeInference;
+import org.apache.calcite.util.Util;
 
-import net.hydromatic.optiq.Function;
+import java.util.List;
 
 /**
 * User-defined scalar function.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
index 14af7dc..338a1ed 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java
@@ -14,25 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
+
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.schema.TableFunction;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlReturnTypeInference;
 
 import java.lang.reflect.Type;
 import java.util.List;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.sql.SqlIdentifier;
-import org.eigenbase.sql.SqlNode;
-import org.eigenbase.sql.type.SqlOperandTypeChecker;
-import org.eigenbase.sql.type.SqlOperandTypeInference;
-import org.eigenbase.sql.type.SqlReturnTypeInference;
-
-import net.hydromatic.optiq.TableFunction;
-
 /**
  * User-defined table function.
- * <p>
- * Created by the validator, after resolving a function call to a function
+ *
+ * <p>Created by the validator, after resolving a function call to a function
  * defined in a Calcite schema.
 */
 public class SqlUserDefinedTableFunction extends SqlUserDefinedFunction {

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java
index 5ae9f02..665f363 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableMacro.java
@@ -14,35 +14,43 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
+
+import org.apache.calcite.adapter.enumerable.RexToLixTranslator;
+import org.apache.calcite.linq4j.tree.BlockBuilder;
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.linq4j.tree.FunctionExpression;
+import org.apache.calcite.linq4j.tree.ParameterExpression;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeFactoryImpl;
+import org.apache.calcite.schema.Function;
+import org.apache.calcite.schema.FunctionParameter;
+import org.apache.calcite.schema.TableMacro;
+import org.apache.calcite.schema.TranslatableTable;
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlUtil;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlReturnTypeInference;
+import org.apache.calcite.util.NlsString;
+import org.apache.calcite.util.Pair;
+import org.apache.calcite.util.Util;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.reltype.RelDataTypeFactoryImpl;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.type.SqlOperandTypeChecker;
-import org.eigenbase.sql.type.SqlOperandTypeInference;
-import org.eigenbase.sql.type.SqlReturnTypeInference;
-import org.eigenbase.util.NlsString;
-import org.eigenbase.util.Pair;
-import org.eigenbase.util.Util;
-
-import net.hydromatic.linq4j.expressions.*;
-
-import net.hydromatic.optiq.Function;
-import net.hydromatic.optiq.FunctionParameter;
-import net.hydromatic.optiq.TableMacro;
-import net.hydromatic.optiq.TranslatableTable;
-import net.hydromatic.optiq.rules.java.RexToLixTranslator;
-
 /**
  * User-defined table macro.
- * <p>
- * Created by the validator, after resolving a function call to a function
+ *
+ * <p>Created by the validator, after resolving a function call to a function
  * defined in a Calcite schema.
 */
 public class SqlUserDefinedTableMacro extends SqlFunction {
@@ -68,8 +76,9 @@ public class SqlUserDefinedTableMacro extends SqlFunction {
   }
 
   /**
-   * Converts arguments from {@link org.eigenbase.sql.SqlNode} to java object
-   * format.
+   * Converts arguments from {@link org.apache.calcite.sql.SqlNode} to
+   * java object format.
+   *
    * @param typeFactory type factory used to convert the arguments
    * @param operandList input arguments
    * @param function target function to get parameter types from
@@ -94,10 +103,10 @@ public class SqlUserDefinedTableMacro extends SqlFunction {
       } else {
         arguments.add(null);
         if (failOnNonLiteral) {
-          throw new IllegalArgumentException(
-            "All arguments of call to macro " + opName + " should be "
-            + "literal. Actual argument #" + pair.left.getOrdinal() + " ("
-            + pair.left.getName() + ") is not literal: " + pair.right);
+          throw new IllegalArgumentException("All arguments of call to macro "
+              + opName + " should be literal. Actual argument #"
+              + pair.left.getOrdinal() + " (" + pair.left.getName()
+              + ") is not literal: " + pair.right);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
index 842c946..10f869d 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java
@@ -14,32 +14,59 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
-
-import java.util.*;
-
-import org.eigenbase.reltype.*;
-import org.eigenbase.resource.Resources;
-import org.eigenbase.sql.*;
-import org.eigenbase.util.*;
+package org.apache.calcite.sql.validate;
+
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.runtime.CalciteException;
+import org.apache.calcite.runtime.Resources;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlDataTypeSpec;
+import org.apache.calcite.sql.SqlDelete;
+import org.apache.calcite.sql.SqlDynamicParam;
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlInsert;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlMerge;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlOperatorTable;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.SqlUpdate;
+import org.apache.calcite.sql.SqlWindow;
+import org.apache.calcite.sql.SqlWith;
+import org.apache.calcite.sql.SqlWithItem;
+import org.apache.calcite.util.Util;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * Validates the parse tree of a SQL statement, and provides semantic
  * information about the parse tree.
  *
- * <p>To create an instance of the default validator implementation, call {@link
- * SqlValidatorUtil#newValidator}.
+ * <p>To create an instance of the default validator implementation, call
+ * {@link SqlValidatorUtil#newValidator}.
  *
  * <h2>Visitor pattern</h2>
  *
- * <p>The validator interface is an instance of the {@link
- * org.eigenbase.util.Glossary#VISITOR_PATTERN visitor pattern}. Implementations
+ * <p>The validator interface is an instance of the
+ * {@link org.apache.calcite.util.Glossary#VISITOR_PATTERN visitor pattern}.
+ * Implementations
  * of the {@link SqlNode#validate} method call the <code>validateXxx</code>
- * method appropriate to the kind of node: {@link
- * SqlLiteral#validate(SqlValidator, SqlValidatorScope)} calls {@link
- * #validateLiteral(org.eigenbase.sql.SqlLiteral)}; {@link
- * SqlCall#validate(SqlValidator, SqlValidatorScope)} calls {@link
- * #validateCall(SqlCall, SqlValidatorScope)}; and so forth.
+ * method appropriate to the kind of node:
+ * <ul>
+ * <li>{@link SqlLiteral#validate(SqlValidator, SqlValidatorScope)}
+ *     calls
+ *     {@link #validateLiteral(org.apache.calcite.sql.SqlLiteral)};
+ * <li>{@link SqlCall#validate(SqlValidator, SqlValidatorScope)}
+ *     calls
+ *     {@link #validateCall(SqlCall, SqlValidatorScope)};
+ * <li>and so forth.</ul>
  *
  * <p>The {@link SqlNode#validateExpr(SqlValidator, SqlValidatorScope)} method
  * is as {@link SqlNode#validate(SqlValidator, SqlValidatorScope)} but is called
@@ -48,27 +75,29 @@ import org.eigenbase.util.*;
  * <h2>Scopes and namespaces</h2>
  *
  * <p>In order to resolve names to objects, the validator builds a map of the
- * structure of the query. This map consists of two types of objects. A {@link
- * SqlValidatorScope} describes the tables and columns accessible at a
+ * structure of the query. This map consists of two types of objects. A
+ * {@link SqlValidatorScope} describes the tables and columns accessible at a
  * particular point in the query; and a {@link SqlValidatorNamespace} is a
  * description of a data source used in a query.
  *
  * <p>There are different kinds of namespace for different parts of the query.
- * for example {@link IdentifierNamespace} for table names, {@link
- * SelectNamespace} for SELECT queries, {@link SetopNamespace} for UNION, EXCEPT
+ * for example {@link IdentifierNamespace} for table names,
+ * {@link SelectNamespace} for SELECT queries,
+ * {@link SetopNamespace} for UNION, EXCEPT
  * and INTERSECT. A validator is allowed to wrap namespaces in other objects
  * which implement {@link SqlValidatorNamespace}, so don't try to cast your
- * namespace or use <code>instanceof</code>; use {@link
- * SqlValidatorNamespace#unwrap(Class)} and {@link
- * SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
+ * namespace or use <code>instanceof</code>; use
+ * {@link SqlValidatorNamespace#unwrap(Class)} and
+ * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
  *
  * <p>The validator builds the map by making a quick scan over the query when
  * the root {@link SqlNode} is first provided. Thereafter, it supplies the
  * correct scope or namespace object when it calls validation methods.</p>
  *
- * <p>The methods {@link #getSelectScope}, {@link #getFromScope}, {@link
- * #getWhereScope}, {@link #getGroupScope}, {@link #getHavingScope}, {@link
- * #getOrderScope} and {@link #getJoinScope} get the correct scope to resolve
+ * <p>The methods {@link #getSelectScope}, {@link #getFromScope},
+ * {@link #getWhereScope}, {@link #getGroupScope}, {@link #getHavingScope},
+ * {@link #getOrderScope} and {@link #getJoinScope} get the correct scope
+ * to resolve
  * names in a particular clause of a SQL statement.</p>
  */
 public interface SqlValidator {
@@ -225,8 +254,8 @@ public interface SqlValidator {
 
   /**
    * Validates the right-hand side of an OVER expression. It might be either
-   * an {@link SqlIdentifier identifier} referencing a window, or an {@link
-   * SqlWindow inline window specification}.
+   * an {@link SqlIdentifier identifier} referencing a window, or an
+   * {@link SqlWindow inline window specification}.
    *
    * @param windowOrId SqlNode that can be either SqlWindow with all the
    *                   components of a window spec or a SqlIdentifier with the
@@ -294,7 +323,7 @@ public interface SqlValidator {
    * @param e    The validation error
    * @return Exception containing positional information, never null
    */
-  EigenbaseContextException newValidationError(
+  CalciteContextException newValidationError(
       SqlNode node,
       Resources.ExInst<SqlValidatorException> e);
 
@@ -443,11 +472,14 @@ public interface SqlValidator {
    *
    * <ul>
    * <li>In FROM ({@link #getFromScope} , you can only see 'foo'.
+   *
    * <li>In WHERE ({@link #getWhereScope}), GROUP BY ({@link #getGroupScope}),
-   * SELECT ({@link #getSelectScope}), and the ON clause of the JOIN ({@link
-   * #getJoinScope}) you can see 'emp', 'dept', and 'foo'.
-   * <li>In ORDER BY ({@link #getOrderScope}), you can see the column alias
-   * 'x'; and tables 'emp', 'dept', and 'foo'.
+   * SELECT ({@link #getSelectScope}), and the ON clause of the JOIN
+   * ({@link #getJoinScope}) you can see 'emp', 'dept', and 'foo'.
+   *
+   * <li>In ORDER BY ({@link #getOrderScope}), you can see the column alias 'x';
+   * and tables 'emp', 'dept', and 'foo'.
+   *
    * </ul>
    *
    * @param select SELECT statement
@@ -457,8 +489,8 @@ public interface SqlValidator {
 
   /**
    * Returns the scope for resolving the SELECT, GROUP BY and HAVING clauses.
-   * Always a {@link SelectScope}; if this is an aggregation query, the {@link
-   * AggregatingScope} is stripped away.
+   * Always a {@link SelectScope}; if this is an aggregation query, the
+   * {@link AggregatingScope} is stripped away.
    *
    * @param select SELECT statement
    * @return naming scope for SELECT statement, sans any aggregating scope
@@ -602,7 +634,7 @@ public interface SqlValidator {
    *                           call
    * @param argTypes           Types of arguments
    */
-  EigenbaseException handleUnresolvedFunction(
+  CalciteException handleUnresolvedFunction(
       SqlCall call,
       SqlFunction unresolvedFunction,
       List<RelDataType> argTypes);

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorCatalogReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorCatalogReader.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorCatalogReader.java
index 378befc..915d9ec 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorCatalogReader.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorCatalogReader.java
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.sql.SqlIdentifier;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
+import java.util.List;
 
 /**
  * Supplies catalog information for {@link SqlValidator}.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorException.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorException.java
index 919cf4f..fe739f2 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorException.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorException.java
@@ -14,29 +14,29 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.logging.*;
+import org.apache.calcite.util.CalciteValidatorException;
+
+import java.util.logging.Logger;
 
 // NOTE:  This class gets compiled independently of everything else so that
 // resource generation can use reflection.  That means it must have no
-// dependencies on other Eigenbase/Farrago code.
-
-import org.eigenbase.util14.*;
+// dependencies on other Calcite code.
 
 /**
  * Exception thrown while validating a SQL statement.
  *
- * <p>Unlike {@link org.eigenbase.util.EigenbaseException}, this is a checked
- * exception, which reminds code authors to wrap it in another exception
+ * <p>Unlike {@link org.apache.calcite.runtime.CalciteException}, this is a
+ * checked exception, which reminds code authors to wrap it in another exception
  * containing the line/column context.
  */
 public class SqlValidatorException extends Exception
-    implements EigenbaseValidatorException {
+    implements CalciteValidatorException {
   //~ Static fields/initializers ---------------------------------------------
 
   private static final Logger LOGGER =
-      Logger.getLogger("org.eigenbase.util.EigenbaseException");
+      Logger.getLogger("org.apache.calcite.runtime.CalciteException");
 
   static final long serialVersionUID = -831683113957131387L;
 
@@ -53,7 +53,7 @@ public class SqlValidatorException extends Exception
       Throwable cause) {
     super(message, cause);
 
-    // TODO: see note in EigenbaseException constructor
+    // TODO: see note in CalciteException constructor
     LOGGER.throwing("SqlValidatorException", "constructor", this);
     LOGGER.severe(toString());
   }

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
index 631ccf6..5dcf320 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
@@ -14,32 +14,97 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
-
-import java.math.*;
-
-import java.util.*;
-import java.util.logging.*;
-
-import org.eigenbase.reltype.*;
-import org.eigenbase.resource.*;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.fun.*;
-import org.eigenbase.sql.parser.*;
-import org.eigenbase.sql.type.*;
-import org.eigenbase.sql.util.*;
-import org.eigenbase.trace.*;
-import org.eigenbase.util.*;
-
-import net.hydromatic.linq4j.Linq4j;
-import net.hydromatic.linq4j.Ord;
+package org.apache.calcite.sql.validate;
+
+import org.apache.calcite.linq4j.Linq4j;
+import org.apache.calcite.linq4j.Ord;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rel.type.RelDataTypeSystem;
+import org.apache.calcite.rel.type.RelRecordType;
+import org.apache.calcite.runtime.CalciteContextException;
+import org.apache.calcite.runtime.CalciteException;
+import org.apache.calcite.runtime.Feature;
+import org.apache.calcite.runtime.Resources;
+import org.apache.calcite.sql.JoinConditionType;
+import org.apache.calcite.sql.JoinType;
+import org.apache.calcite.sql.SqlAccessEnum;
+import org.apache.calcite.sql.SqlAccessType;
+import org.apache.calcite.sql.SqlBasicCall;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlCallBinding;
+import org.apache.calcite.sql.SqlDataTypeSpec;
+import org.apache.calcite.sql.SqlDelete;
+import org.apache.calcite.sql.SqlDynamicParam;
+import org.apache.calcite.sql.SqlExplain;
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlInsert;
+import org.apache.calcite.sql.SqlIntervalLiteral;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlJoin;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlMerge;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlOperatorTable;
+import org.apache.calcite.sql.SqlOrderBy;
+import org.apache.calcite.sql.SqlSampleSpec;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.SqlSelectKeyword;
+import org.apache.calcite.sql.SqlSyntax;
+import org.apache.calcite.sql.SqlUnresolvedFunction;
+import org.apache.calcite.sql.SqlUpdate;
+import org.apache.calcite.sql.SqlUtil;
+import org.apache.calcite.sql.SqlWindow;
+import org.apache.calcite.sql.SqlWith;
+import org.apache.calcite.sql.SqlWithItem;
+import org.apache.calcite.sql.fun.SqlCase;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.AssignableOperandTypeChecker;
+import org.apache.calcite.sql.type.ReturnTypes;
+import org.apache.calcite.sql.type.SqlOperandTypeInference;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.sql.type.SqlTypeUtil;
+import org.apache.calcite.sql.util.SqlShuttle;
+import org.apache.calcite.sql.util.SqlVisitor;
+import org.apache.calcite.util.BitString;
+import org.apache.calcite.util.Bug;
+import org.apache.calcite.util.Pair;
+import org.apache.calcite.util.Util;
+import org.apache.calcite.util.trace.CalciteTrace;
 
 import com.google.common.base.Function;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
-
-import static org.eigenbase.sql.SqlUtil.stripAs;
-import static org.eigenbase.util.Static.RESOURCE;
+import com.google.common.collect.Sets;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static org.apache.calcite.sql.SqlUtil.stripAs;
+import static org.apache.calcite.util.Static.RESOURCE;
 
 /**
  * Default implementation of {@link SqlValidator}.
@@ -47,7 +112,7 @@ import static org.eigenbase.util.Static.RESOURCE;
 public class SqlValidatorImpl implements SqlValidatorWithHints {
   //~ Static fields/initializers ---------------------------------------------
 
-  public static final Logger TRACER = EigenbaseTrace.PARSER_LOGGER;
+  public static final Logger TRACER = CalciteTrace.PARSER_LOGGER;
 
   /**
    * Alias generated for the source table when rewriting UPDATE to MERGE.
@@ -134,18 +199,19 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
       new IdentityHashMap<SqlSelect, SqlValidatorScope>();
 
   /**
-   * Maps a {@link SqlNode node} to the {@link SqlValidatorNamespace
-   * namespace} which describes what columns they contain.
+   * Maps a {@link SqlNode node} to the
+   * {@link SqlValidatorNamespace namespace} which describes what columns they
+   * contain.
    */
   protected final Map<SqlNode, SqlValidatorNamespace> namespaces =
       new IdentityHashMap<SqlNode, SqlValidatorNamespace>();
 
   /**
    * Set of select expressions used as cursor definitions. In standard SQL,
-   * only the top-level SELECT is a cursor; Eigenbase extends this with
+   * only the top-level SELECT is a cursor; Calcite extends this with
    * cursors as inputs to table functions.
    */
-  private final Set<SqlNode> cursorSet = new IdentityHashSet<SqlNode>();
+  private final Set<SqlNode> cursorSet = Sets.newIdentityHashSet();
 
   /**
    * Stack of objects that maintain information about function calls. A stack
@@ -1403,7 +1469,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
     return type;
   }
 
-  public EigenbaseException handleUnresolvedFunction(
+  public CalciteException handleUnresolvedFunction(
       SqlCall call,
       SqlFunction unresolvedFunction,
       List<RelDataType> argTypes) {
@@ -2498,7 +2564,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
         // ensure qualifier is good before attempting to validate literal
         validateIntervalQualifier(intervalQualifier);
         String intervalStr = interval.getIntervalLiteral();
-        // throws EigenbaseContextException if string is invalid
+        // throws CalciteContextException if string is invalid
         int[] values = intervalQualifier.evaluateIntervalLiteral(intervalStr,
             literal.getParserPosition(), typeFactory.getTypeSystem());
         Util.discard(values);
@@ -3544,7 +3610,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
   public void validateDynamicParam(SqlDynamicParam dynamicParam) {
   }
 
-  public EigenbaseContextException newValidationError(SqlNode node,
+  public CalciteContextException newValidationError(SqlNode node,
       Resources.ExInst<SqlValidatorException> e) {
     assert node != null;
     final SqlParserPos pos = node.getParserPosition();
@@ -3763,8 +3829,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
     final List<RelDataType> types = new ArrayList<RelDataType>();
     sqlQuery.accept(
         new SqlShuttle() {
-          @Override
-          public SqlNode visit(SqlDynamicParam param) {
+          @Override public SqlNode visit(SqlDynamicParam param) {
             RelDataType type = getValidatedNodeType(param);
             types.add(type);
             return param;
@@ -3773,13 +3838,11 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
     return typeFactory.createStructType(
         types,
         new AbstractList<String>() {
-          @Override
-          public String get(int index) {
+          @Override public String get(int index) {
             return "?" + index;
           }
 
-          @Override
-          public int size() {
+          @Override public int size() {
             return types.size();
           }
         });
@@ -4075,7 +4138,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
                   literal, RESOURCE.orderByOrdinalOutOfRange());
             }
 
-            // SQL ordinals are 1-based, but SortRel's are 0-based
+            // SQL ordinals are 1-based, but Sort's are 0-based
             int ordinal = intValue - 1;
             return nthSelectItem(ordinal, literal.getParserPosition());
           }
@@ -4141,6 +4204,7 @@ public class SqlValidatorImpl implements SqlValidatorWithHints {
     }
   }
 
+  /** Information about an identifier in a particular scope. */
   protected static class IdInfo {
     public final SqlValidatorScope scope;
     public final SqlIdentifier id;

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
index 549664d..b95204e 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java
@@ -14,13 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.util.Pair;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
-import org.eigenbase.util.*;
+import java.util.List;
 
 /**
  * A namespace describes the relation returned by a section of a SQL query.
@@ -33,17 +33,17 @@ import org.eigenbase.util.*;
  * namespace contains the constituent columns) and a subquery (the namespace
  * contains the columns in the SELECT clause of the subquery).
  *
- * <p>These various kinds of namespace are implemented by classes {@link
- * IdentifierNamespace} for table names, {@link SelectNamespace} for SELECT
- * queries, {@link SetopNamespace} for UNION, EXCEPT and INTERSECT, and so
- * forth. But if you are looking at a SELECT query and call {@link
- * SqlValidator#getNamespace(org.eigenbase.sql.SqlNode)}, you may not get a
- * SelectNamespace. Why? Because the validator is allowed to wrap namespaces in
- * other objects which implement {@link SqlValidatorNamespace}. Your
- * SelectNamespace will be there somewhere, but might be one or two levels deep.
- * Don't try to cast the namespace or use <code>instanceof</code>; use {@link
- * SqlValidatorNamespace#unwrap(Class)} and {@link
- * SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
+ * <p>These various kinds of namespace are implemented by classes
+ * {@link IdentifierNamespace} for table names, {@link SelectNamespace} for
+ * SELECT queries, {@link SetopNamespace} for UNION, EXCEPT and INTERSECT, and
+ * so forth. But if you are looking at a SELECT query and call
+ * {@link SqlValidator#getNamespace(org.apache.calcite.sql.SqlNode)}, you may
+ * not get a SelectNamespace. Why? Because the validator is allowed to wrap
+ * namespaces in other objects which implement
+ * {@link SqlValidatorNamespace}. Your SelectNamespace will be there somewhere,
+ * but might be one or two levels deep.  Don't try to cast the namespace or use
+ * <code>instanceof</code>; use {@link SqlValidatorNamespace#unwrap(Class)} and
+ * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.</p>
  *
  * @see SqlValidator
  * @see SqlValidatorScope
@@ -145,8 +145,8 @@ public interface SqlValidatorNamespace {
   /**
    * Returns a list of expressions which are monotonic in this namespace. For
    * example, if the namespace represents a relation ordered by a column
-   * called "TIMESTAMP", then the list would contain a {@link
-   * org.eigenbase.sql.SqlIdentifier} called "TIMESTAMP".
+   * called "TIMESTAMP", then the list would contain a
+   * {@link org.apache.calcite.sql.SqlIdentifier} called "TIMESTAMP".
    */
   List<Pair<SqlNode, SqlMonotonicity>> getMonotonicExprs();
 

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java
index 20a0dfb..db1e294 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java
@@ -14,21 +14,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlWindow;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
+import java.util.List;
 
 /**
  * Name-resolution scope. Represents any position in a parse tree than an
  * expression can be, or anything in the parse tree which has columns.
  *
- * <p>When validating an expression, say "foo"."bar", you first use the {@link
- * #resolve} method of the scope where the expression is defined to locate
- * "foo". If successful, this returns a {@link SqlValidatorNamespace namespace}
- * describing the type of the resulting object.
+ * <p>When validating an expression, say "foo"."bar", you first use the
+ * {@link #resolve} method of the scope where the expression is defined to
+ * locate "foo". If successful, this returns a
+ * {@link SqlValidatorNamespace namespace} describing the type of the resulting
+ * object.
  */
 public interface SqlValidatorScope {
   //~ Methods ----------------------------------------------------------------
@@ -59,11 +64,11 @@ public interface SqlValidatorScope {
    * Finds the table alias which is implicitly qualifying an unqualified
    * column name. Throws an error if there is not exactly one table.
    *
-   * <p>This method is only implemented in scopes (such as {@link
-   * org.eigenbase.sql.validate.SelectScope}) which can be the context for
-   * name-resolution. In scopes such as {@link
-   * org.eigenbase.sql.validate.IdentifierNamespace}, it throws {@link
-   * UnsupportedOperationException}.</p>
+   * <p>This method is only implemented in scopes (such as
+   * {@link org.apache.calcite.sql.validate.SelectScope}) which can be the
+   * context for name-resolution. In scopes such as
+   * {@link org.apache.calcite.sql.validate.IdentifierNamespace}, it throws
+   * {@link UnsupportedOperationException}.</p>
    *
    * @param columnName Column name
    * @param ctx        Validation context, to appear in any error thrown

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorTable.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorTable.java
index cfce480..7b2d48c 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorTable.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorTable.java
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.List;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlAccessType;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
+import java.util.List;
 
 /**
  * Supplies a {@link SqlValidator} with the metadata for a table.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
index 3a9e919..304853a 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java
@@ -14,20 +14,35 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
-
-import java.nio.charset.*;
-import java.util.*;
-
-import org.eigenbase.relopt.*;
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.fun.*;
-import org.eigenbase.sql.parser.*;
-import org.eigenbase.sql.type.*;
-import org.eigenbase.util.*;
-
-import net.hydromatic.optiq.prepare.Prepare;
+package org.apache.calcite.sql.validate;
+
+import org.apache.calcite.plan.RelOptSchemaWithSampling;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.prepare.Prepare;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlDataTypeSpec;
+import org.apache.calcite.sql.SqlDynamicParam;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlOperatorTable;
+import org.apache.calcite.sql.SqlUtil;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeUtil;
+import org.apache.calcite.util.Util;
+
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Utility methods related to validation.
@@ -101,11 +116,10 @@ public class SqlValidatorUtil {
         if (false) {
           // todo: enable this checking when we have a charset to
           //   collation mapping
-          throw new Error(
-              type.toString()
-                  + " was found to have charset '" + strCharset.name()
-                  + "' and a mismatched collation charset '"
-                  + colCharset.name() + "'");
+          throw new Error(type.toString()
+              + " was found to have charset '" + strCharset.name()
+              + "' and a mismatched collation charset '"
+              + colCharset.name() + "'");
         }
       }
     }
@@ -367,6 +381,8 @@ public class SqlValidatorUtil {
     }
   }
 
+  /** Suggests candidates for unique names, given the number of attempts so far
+   * and the number of expressions in the project list. */
   interface Suggester {
     String apply(String original, int attempt, int size);
   }

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorWithHints.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorWithHints.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorWithHints.java
index d6fcc22..d131d94 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorWithHints.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorWithHints.java
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.*;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.parser.SqlParserPos;
 
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.parser.*;
+import java.util.List;
 
 /**
  * Extends {@link SqlValidator} to allow discovery of useful data such as fully
@@ -32,7 +33,7 @@ public interface SqlValidatorWithHints extends SqlValidator {
   /**
    * Looks up completion hints for a syntatically correct SQL statement that
    * has been parsed into an expression tree. (Note this should be called
-   * after {@link #validate(org.eigenbase.sql.SqlNode)}.
+   * after {@link #validate(org.apache.calcite.sql.SqlNode)}.
    *
    * @param topNode top of expression tree in which to lookup completion hints
    * @param pos     indicates the position in the sql statement we want to get
@@ -54,8 +55,9 @@ public interface SqlValidatorWithHints extends SqlValidator {
    *
    * @param topNode top of expression tree in which to lookup the qualfied
    *                name for the SqlIdentifier
-   * @param pos     indicates the position of the {@link SqlIdentifier} in the sql
-   *                statement we want to get the qualified name for
+   * @param pos indicates the position of the {@link SqlIdentifier} in
+   *                the SQL statement we want to get the qualified
+   *                name for
    * @return a string of the fully qualified name of the {@link SqlIdentifier}
    * if the Parser position represents a valid {@link SqlIdentifier}. Else
    * return an empty string

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java
index 061a608..05ddf53 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java
@@ -14,12 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlInsert;
+import org.apache.calcite.sql.SqlNode;
 
-import static org.eigenbase.util.Static.RESOURCE;
+import static org.apache.calcite.util.Static.RESOURCE;
 
 /**
  * Namespace for a table constructor <code>VALUES (expr, expr, ...)</code>.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java
index 80f11f1..1ec155e 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.sql.SqlNode;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlNode;
 
 /** Namespace based on a table from the catalog. */
 class TableNamespace extends AbstractNamespace {
@@ -39,8 +39,7 @@ class TableNamespace extends AbstractNamespace {
     return null;
   }
 
-  @Override
-  public SqlValidatorTable getTable() {
+  @Override public SqlValidatorTable getTable() {
     return table;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java
index 6a9897b..f5829f3 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import org.eigenbase.reltype.*;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.fun.*;
-import org.eigenbase.sql.type.*;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.type.MultisetSqlType;
 
 /**
  * Namespace for UNNEST.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java
index 066551b..040f080 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java
@@ -14,15 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.sql.SqlIdentifier;
-import org.eigenbase.sql.SqlNode;
-import org.eigenbase.sql.SqlWithItem;
-import org.eigenbase.util.Pair;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWithItem;
+import org.apache.calcite.util.Pair;
 
 /** Very similar to {@link AliasNamespace}. */
 class WithItemNamespace extends AbstractNamespace {
@@ -68,8 +68,7 @@ class WithItemNamespace extends AbstractNamespace {
       }
       ++i;
     }
-    throw new AssertionError(
-        "unknown field '" + name
+    throw new AssertionError("unknown field '" + name
         + "' in rowtype " + underlyingRowType);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java
index 30c4d3b..d3cfb9a 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java
@@ -14,11 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.sql.*;
-import org.eigenbase.util.Util;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWith;
+import org.apache.calcite.sql.SqlWithItem;
+import org.apache.calcite.util.Util;
 
 /**
  * Namespace for <code>WITH</code> clause.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
index 47a24ea..1866d7d 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
-import java.util.List;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlWithItem;
 
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.SqlWithItem;
+import java.util.List;
 
 /** Scope providing the objects that are available after evaluating an item
  * in a WITH clause.
@@ -46,16 +46,14 @@ class WithScope extends ListScope {
     return withItem;
   }
 
-  @Override
-  public SqlValidatorNamespace getTableNamespace(List<String> names) {
+  @Override public SqlValidatorNamespace getTableNamespace(List<String> names) {
     if (names.size() == 1 && names.get(0).equals(withItem.name.getSimple())) {
       return validator.getNamespace(withItem);
     }
     return super.getTableNamespace(names);
   }
 
-  @Override
-  public SqlValidatorNamespace resolve(String name,
+  @Override public SqlValidatorNamespace resolve(String name,
       SqlValidatorScope[] ancestorOut,
       int[] offsetOut) {
     if (name.equals(withItem.name.getSimple())) {

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql/validate/package-info.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/validate/package-info.java b/core/src/main/java/org/apache/calcite/sql/validate/package-info.java
index 12820a3..d904da3 100644
--- a/core/src/main/java/org/apache/calcite/sql/validate/package-info.java
+++ b/core/src/main/java/org/apache/calcite/sql/validate/package-info.java
@@ -18,6 +18,6 @@
 /**
  * SQL validation.
  */
-package org.eigenbase.sql.validate;
+package org.apache.calcite.sql.validate;
 
 // End package-info.java

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql2rel/DefaultValueFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/DefaultValueFactory.java b/core/src/main/java/org/apache/calcite/sql2rel/DefaultValueFactory.java
index 9d503b8..1e34826 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/DefaultValueFactory.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/DefaultValueFactory.java
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql2rel;
+package org.apache.calcite.sql2rel;
 
-import java.util.List;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlFunction;
 
-import org.eigenbase.relopt.*;
-import org.eigenbase.reltype.*;
-import org.eigenbase.rex.*;
-import org.eigenbase.sql.*;
+import java.util.List;
 
 /**
  * DefaultValueFactory supplies default values for INSERT, UPDATE, and NEW.

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/a0ba73cd/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java b/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java
index 73f6dc5..fcd3f4c 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java
@@ -14,16 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.eigenbase.sql2rel;
+package org.apache.calcite.sql2rel;
 
-import java.lang.reflect.*;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.util.Util;
 
-import java.util.*;
-
-import org.eigenbase.rex.*;
-import org.eigenbase.sql.*;
-import org.eigenbase.sql.parser.*;
-import org.eigenbase.util.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Implementation of {@link SqlRexConvertletTable} which uses reflection to call
@@ -191,8 +195,8 @@ public class ReflectiveConvertletTable implements SqlRexConvertletTable {
   /**
    * Registers a convertlet for a given operator instance
    *
-   * @param op         Operator instance, say {@link
-   *                   org.eigenbase.sql.fun.SqlStdOperatorTable#MINUS}
+   * @param op         Operator instance, say
+   * {@link org.apache.calcite.sql.fun.SqlStdOperatorTable#MINUS}
    * @param convertlet Convertlet
    */
   protected void registerOp(SqlOperator op, SqlRexConvertlet convertlet) {


Mime
View raw message