You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2015/06/13 02:38:08 UTC

[4/7] incubator-calcite git commit: Remove deprecated SqlTypeName methods

Remove deprecated SqlTypeName methods


Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/67189631
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/67189631
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/67189631

Branch: refs/heads/master
Commit: 6718963132e8984877c379bc5fc95534b31022e4
Parents: 87acda3
Author: Julian Hyde <jh...@apache.org>
Authored: Thu Jun 11 22:55:39 2015 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Thu Jun 11 23:46:07 2015 -0700

----------------------------------------------------------------------
 .../apache/calcite/sql/type/SqlTypeName.java    | 42 --------------------
 .../apache/calcite/test/SqlValidatorTest.java   |  9 +++--
 2 files changed, 5 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/67189631/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java
index a7f6880..5f5b90c 100644
--- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java
+++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java
@@ -17,7 +17,6 @@
 package org.apache.calcite.sql.type;
 
 import org.apache.calcite.avatica.util.DateTimeUtils;
-import org.apache.calcite.rel.type.RelDataTypeSystem;
 import org.apache.calcite.sql.SqlLiteral;
 import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.util.Util;
@@ -299,18 +298,6 @@ public enum SqlTypeName {
   }
 
   /**
-   * Returns the default precision for this type if supported, otherwise -1 if
-   * precision is either unsupported or must be specified explicitly.
-   *
-   * @deprecated Use
-   * {@link org.apache.calcite.rel.type.RelDataTypeSystem#getDefaultPrecision(SqlTypeName)};
-   * will be removed after calcite-0.9.1.
-   */
-  public int getDefaultPrecision() {
-    return RelDataTypeSystem.DEFAULT.getDefaultPrecision(this);
-  }
-
-  /**
    * @return default scale for this type if supported, otherwise -1 if scale
    * is either unsupported or must be specified explicitly
    */
@@ -676,35 +663,6 @@ public enum SqlTypeName {
   }
 
   /**
-   * Returns the maximum precision (or length) allowed for this type, or -1 if
-   * precision/length are not applicable for this type.
-   *
-   * @return Maximum allowed precision
-   *
-   * @deprecated Use
-   * {@link org.apache.calcite.rel.type.RelDataTypeSystem#getMaxScale(SqlTypeName)};
-   * will be removed after calcite-0.9.1.
-   */
-  public int getMaxPrecision() {
-    return RelDataTypeSystem.DEFAULT.getMaxPrecision(this);
-  }
-
-  /**
-   * Returns the maximum scale (or fractional second precision in the case of
-   * intervals) allowed for this type, or -1 if precision/length are not
-   * applicable for this type.
-   *
-   * @return Maximum allowed scale
-   *
-   * @deprecated Use
-   * {@link org.apache.calcite.rel.type.RelDataTypeSystem#getMaxScale(SqlTypeName)};
-   * will be removed after calcite-0.9.1.
-   */
-  public int getMaxScale() {
-    return RelDataTypeSystem.DEFAULT.getMaxScale(this);
-  }
-
-  /**
    * Returns the minimum precision (or length) allowed for this type, or -1 if
    * precision/length are not applicable for this type.
    *

http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/67189631/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
index af82649..811343b 100644
--- a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
+++ b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
@@ -3430,10 +3430,11 @@ public class SqlValidatorTest extends SqlValidatorTestCase {
         SqlTypeName.INTERVAL_YEAR_MONTH.getMinPrecision() == 1);
     assertTrue(
         SqlTypeName.INTERVAL_DAY_TIME.getMinPrecision() == 1);
-    assertTrue(
-        SqlTypeName.INTERVAL_YEAR_MONTH.getMaxPrecision() == 10);
-    assertTrue(
-        SqlTypeName.INTERVAL_DAY_TIME.getMaxPrecision() == 10);
+    final RelDataTypeSystem defTypeSystem = RelDataTypeSystem.DEFAULT;
+    assertEquals(10,
+        defTypeSystem.getMaxPrecision(SqlTypeName.INTERVAL_YEAR_MONTH));
+    assertEquals(10,
+        defTypeSystem.getMaxPrecision(SqlTypeName.INTERVAL_DAY_TIME));
     assertEquals(2,
         typeSystem.getDefaultPrecision(SqlTypeName.INTERVAL_YEAR_MONTH));
     assertEquals(2,