beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From taki...@apache.org
Subject [1/2] beam git commit: [BEAM-2444] BeamSql: use java standard exception
Date Thu, 15 Jun 2017 21:22:01 GMT
Repository: beam
Updated Branches:
  refs/heads/DSL_SQL 07fda7c2d -> 2e9253401


[BEAM-2444] BeamSql: use java standard exception


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/83e6c204
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/83e6c204
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/83e6c204

Branch: refs/heads/DSL_SQL
Commit: 83e6c2046571c14d104e622b2e2ad656143e09aa
Parents: 07fda7c
Author: James Xu <xumingmingv@gmail.com>
Authored: Thu Jun 15 10:57:10 2017 +0800
Committer: James Xu <xumingmingv@gmail.com>
Committed: Thu Jun 15 10:57:10 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/beam/dsls/sql/BeamSql.java  |  6 +--
 .../exception/BeamInvalidOperatorException.java | 34 ---------------
 .../exception/BeamSqlUnsupportedException.java  | 34 ---------------
 .../sql/exception/InvalidFieldException.java    | 34 ---------------
 .../beam/dsls/sql/exception/package-info.java   | 23 ----------
 .../dsls/sql/interpreter/BeamSqlFnExecutor.java | 12 +++--
 .../operator/BeamSqlCompareExpression.java      |  3 +-
 .../BeamSqlLargerThanEqualExpression.java       |  3 +-
 .../operator/BeamSqlLargerThanExpression.java   |  3 +-
 .../BeamSqlLessThanEqualExpression.java         |  3 +-
 .../operator/BeamSqlLessThanExpression.java     |  3 +-
 .../interpreter/operator/BeamSqlPrimitive.java  |  7 +--
 .../operator/date/BeamSqlExtractExpression.java |  5 +--
 .../apache/beam/dsls/sql/rel/BeamSortRel.java   | 10 ++---
 .../beam/dsls/sql/rule/BeamAggregationRule.java |  3 +-
 .../dsls/sql/schema/BeamPCollectionTable.java   |  3 +-
 .../apache/beam/dsls/sql/schema/BeamSqlRow.java | 46 ++++++++++----------
 .../beam/dsls/sql/schema/BeamSqlRowCoder.java   |  6 ++-
 .../beam/dsls/sql/schema/BeamTableUtils.java    |  4 +-
 .../schema/UnsupportedDataTypeException.java    | 32 --------------
 .../transform/BeamAggregationTransforms.java    | 11 +++--
 .../operator/BeamSqlInputRefExpressionTest.java |  3 +-
 .../operator/BeamSqlPrimitiveTest.java          |  9 ++--
 .../beam/dsls/sql/rel/BeamSortRelTest.java      |  4 +-
 24 files changed, 61 insertions(+), 240 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/BeamSql.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/BeamSql.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/BeamSql.java
index ae281ac..0d6454b 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/BeamSql.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/BeamSql.java
@@ -17,7 +17,6 @@
  */
 package org.apache.beam.dsls.sql;
 
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.rel.BeamRelNode;
 import org.apache.beam.dsls.sql.schema.BeamPCollectionTable;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
@@ -146,7 +145,7 @@ public class BeamSql {
     }
 
     public SimpleQueryTransform withUdf(String udfName){
-      throw new BeamSqlUnsupportedException("Pending for UDF support");
+      throw new UnsupportedOperationException("Pending for UDF support");
     }
 
     @Override
@@ -165,7 +164,8 @@ public class BeamSql {
         return PCollectionTuple.of(new TupleTag<BeamSqlRow>(tableName), input)
             .apply(BeamSql.query(sqlQuery));
       } else {
-        throw new BeamSqlUnsupportedException(sqlNode.toString());
+        throw new UnsupportedOperationException(
+            "Sql operation: " + sqlNode.toString() + " is not supported!");
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamInvalidOperatorException.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamInvalidOperatorException.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamInvalidOperatorException.java
deleted file mode 100644
index 281ef89..0000000
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamInvalidOperatorException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed 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.beam.dsls.sql.exception;
-
-/**
- * operation is not supported.
- *
- */
-public class BeamInvalidOperatorException extends RuntimeException {
-
-  public BeamInvalidOperatorException(String string) {
-    super(string);
-  }
-
-  public BeamInvalidOperatorException() {
-    super();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamSqlUnsupportedException.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamSqlUnsupportedException.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamSqlUnsupportedException.java
deleted file mode 100644
index 02e843b..0000000
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/BeamSqlUnsupportedException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed 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.beam.dsls.sql.exception;
-
-/**
- * Generic exception for un-supported features/functions in BeamSQL.
- *
- */
-public class BeamSqlUnsupportedException extends RuntimeException {
-
-  public BeamSqlUnsupportedException(String string) {
-    super(string);
-  }
-
-  public BeamSqlUnsupportedException() {
-    super();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/InvalidFieldException.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/InvalidFieldException.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/InvalidFieldException.java
deleted file mode 100644
index 82ebabe..0000000
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/InvalidFieldException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed 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.beam.dsls.sql.exception;
-
-/**
- * Exception when the field value and field type is not compatible.
- *
- */
-public class InvalidFieldException extends RuntimeException {
-
-  public InvalidFieldException() {
-    super();
-  }
-
-  public InvalidFieldException(String message) {
-    super(message);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/package-info.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/package-info.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/package-info.java
deleted file mode 100644
index 619100c..0000000
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/exception/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed 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.
- */
-
-/**
- * Exceptions in BeamSQL.
- *
- */
-package org.apache.beam.dsls.sql.exception;

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/BeamSqlFnExecutor.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/BeamSqlFnExecutor.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/BeamSqlFnExecutor.java
index 2f5ae76..091dbf7 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/BeamSqlFnExecutor.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/BeamSqlFnExecutor.java
@@ -21,8 +21,6 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
-
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlCaseExpression;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlEqualExpression;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlExpression;
@@ -103,8 +101,8 @@ public class BeamSqlFnExecutor implements BeamSqlExpressionExecutor {
         exps.add(buildExpression(rexNode));
       }
     } else {
-      throw new BeamSqlUnsupportedException(
-          String.format("%s is not supported yet", relNode.getClass().toString()));
+      throw new UnsupportedOperationException(
+          String.format("%s is not supported yet!", relNode.getClass().toString()));
     }
   }
 
@@ -318,12 +316,12 @@ public class BeamSqlFnExecutor implements BeamSqlExpressionExecutor
{
             ret = new BeamSqlUdfExpression(fn.method, subExps,
               ((RexCall) rexNode).type.getSqlTypeName());
         } else {
-          throw new BeamSqlUnsupportedException("Operator: " + opName + " not supported yet!");
+          throw new UnsupportedOperationException("Operator: " + opName + " is not supported
yet!");
         }
       }
     } else {
-      throw new BeamSqlUnsupportedException(
-          String.format("%s is not supported yet", rexNode.getClass().toString()));
+      throw new UnsupportedOperationException(
+          String.format("%s is not supported yet!", rexNode.getClass().toString()));
     }
 
     if (ret != null && !ret.accept()) {

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlCompareExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlCompareExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlCompareExpression.java
index d75e13d..3d96616 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlCompareExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlCompareExpression.java
@@ -18,7 +18,6 @@
 package org.apache.beam.dsls.sql.interpreter.operator;
 
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
 import org.apache.calcite.sql.type.SqlTypeName;
 
@@ -69,7 +68,7 @@ public abstract class BeamSqlCompareExpression extends BeamSqlExpression
{
       return BeamSqlPrimitive.of(SqlTypeName.BOOLEAN,
           compare((CharSequence) leftValue, (CharSequence) rightValue));
     default:
-      throw new BeamSqlUnsupportedException(toString());
+      throw new UnsupportedOperationException(toString());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanEqualExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanEqualExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanEqualExpression.java
index d78c020..76ca71d 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanEqualExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanEqualExpression.java
@@ -18,7 +18,6 @@
 package org.apache.beam.dsls.sql.interpreter.operator;
 
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 
 /**
  * {@code BeamSqlExpression} for {@code >=} operation.
@@ -36,7 +35,7 @@ public class BeamSqlLargerThanEqualExpression extends BeamSqlCompareExpression
{
 
   @Override
   public Boolean compare(Boolean leftValue, Boolean rightValue) {
-    throw new BeamInvalidOperatorException(">= is not supported for Boolean.");
+    throw new IllegalArgumentException(">= is not supported for Boolean.");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanExpression.java
index 0b0d6f1..c7ce836 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLargerThanExpression.java
@@ -18,7 +18,6 @@
 package org.apache.beam.dsls.sql.interpreter.operator;
 
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 
 /**
  * {@code BeamSqlExpression} for {@code >} operation.
@@ -36,7 +35,7 @@ public class BeamSqlLargerThanExpression extends BeamSqlCompareExpression
{
 
   @Override
   public Boolean compare(Boolean leftValue, Boolean rightValue) {
-    throw new BeamInvalidOperatorException("> is not supported for Boolean.");
+    throw new IllegalArgumentException("> is not supported for Boolean.");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanEqualExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanEqualExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanEqualExpression.java
index b6f7c9a..1791b79 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanEqualExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanEqualExpression.java
@@ -18,7 +18,6 @@
 package org.apache.beam.dsls.sql.interpreter.operator;
 
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 
 /**
  * {@code BeamSqlExpression} for {@code <=} operation.
@@ -36,7 +35,7 @@ public class BeamSqlLessThanEqualExpression extends BeamSqlCompareExpression
{
 
   @Override
   public Boolean compare(Boolean leftValue, Boolean rightValue) {
-    throw new BeamInvalidOperatorException("<= is not supported for Boolean.");
+    throw new IllegalArgumentException("<= is not supported for Boolean.");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanExpression.java
index 216a621..7382d92 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlLessThanExpression.java
@@ -18,7 +18,6 @@
 package org.apache.beam.dsls.sql.interpreter.operator;
 
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 
 /**
  * {@code BeamSqlExpression} for {@code <} operation.
@@ -36,7 +35,7 @@ public class BeamSqlLessThanExpression extends BeamSqlCompareExpression
{
 
   @Override
   public Boolean compare(Boolean leftValue, Boolean rightValue) {
-    throw new BeamInvalidOperatorException("< is not supported for Boolean.");
+    throw new IllegalArgumentException("< is not supported for Boolean.");
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitive.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitive.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitive.java
index 99f8473..b9d1559 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitive.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitive.java
@@ -21,9 +21,6 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.List;
-
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.util.NlsString;
@@ -51,7 +48,7 @@ public class BeamSqlPrimitive<T> extends BeamSqlExpression{
     exp.outputType = outputType;
     exp.value = value;
     if (!exp.accept()) {
-      throw new BeamInvalidOperatorException(
+      throw new IllegalArgumentException(
           String.format("value [%s] doesn't match type [%s].", value, outputType));
     }
     return exp;
@@ -139,7 +136,7 @@ public class BeamSqlPrimitive<T> extends BeamSqlExpression{
       // for SYMBOL, it supports anything...
       return true;
     default:
-      throw new BeamSqlUnsupportedException(outputType.name());
+      throw new UnsupportedOperationException(outputType.name());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/date/BeamSqlExtractExpression.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/date/BeamSqlExtractExpression.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/date/BeamSqlExtractExpression.java
index 347a201..93d2eb6 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/date/BeamSqlExtractExpression.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/interpreter/operator/date/BeamSqlExtractExpression.java
@@ -23,8 +23,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlExpression;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlPrimitive;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
@@ -105,7 +103,8 @@ public class BeamSqlExtractExpression extends BeamSqlExpression {
         return BeamSqlPrimitive.of(outputType, ret);
 
       default:
-        throw new BeamSqlUnsupportedException("Extract for time unit: " + unit + " not supported!");
+        throw new UnsupportedOperationException(
+            "Extract for time unit: " + unit + " not supported!");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rel/BeamSortRel.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rel/BeamSortRel.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rel/BeamSortRel.java
index 02fc648..ff8bbcf 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rel/BeamSortRel.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rel/BeamSortRel.java
@@ -24,13 +24,10 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
-
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.planner.BeamSqlRelUtils;
 import org.apache.beam.dsls.sql.schema.BeamSqlRecordType;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
 import org.apache.beam.dsls.sql.schema.BeamSqlRowCoder;
-import org.apache.beam.dsls.sql.schema.UnsupportedDataTypeException;
 import org.apache.beam.sdk.coders.ListCoder;
 import org.apache.beam.sdk.transforms.DoFn;
 import org.apache.beam.sdk.transforms.Flatten;
@@ -111,7 +108,7 @@ public class BeamSortRel extends Sort implements BeamRelNode {
     }
 
     if (fetch == null) {
-      throw new BeamSqlUnsupportedException("ORDER BY without a LIMIT is not supported!");
+      throw new UnsupportedOperationException("ORDER BY without a LIMIT is not supported!");
     }
 
     RexLiteral fetchLiteral = (RexLiteral) fetch;
@@ -131,7 +128,7 @@ public class BeamSortRel extends Sort implements BeamRelNode {
     Type windowType = upstream.getWindowingStrategy().getWindowFn()
         .getWindowTypeDescriptor().getType();
     if (!windowType.equals(GlobalWindow.class)) {
-      throw new BeamSqlUnsupportedException(
+      throw new UnsupportedOperationException(
           "`ORDER BY` is only supported for GlobalWindow, actual window: " + windowType);
     }
 
@@ -230,7 +227,8 @@ public class BeamSortRel extends Sort implements BeamRelNode {
               fieldRet = row1.getDate(fieldIndex).compareTo(row2.getDate(fieldIndex));
               break;
             default:
-              throw new UnsupportedDataTypeException(fieldType);
+              throw new UnsupportedOperationException(
+                  "Data type: " + fieldType + " not supported yet!");
           }
         }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rule/BeamAggregationRule.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rule/BeamAggregationRule.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rule/BeamAggregationRule.java
index 249d02d..6e843d4 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rule/BeamAggregationRule.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/rule/BeamAggregationRule.java
@@ -20,7 +20,6 @@ package org.apache.beam.dsls.sql.rule;
 import com.google.common.collect.ImmutableList;
 import java.util.GregorianCalendar;
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.InvalidFieldException;
 import org.apache.beam.dsls.sql.rel.BeamAggregationRel;
 import org.apache.beam.dsls.sql.rel.BeamLogicalConvention;
 import org.apache.beam.sdk.transforms.windowing.AfterProcessingTime;
@@ -156,7 +155,7 @@ public class BeamAggregationRule extends RelOptRule {
     if (parameterNode instanceof RexLiteral) {
       return RexLiteral.intValue(parameterNode);
     } else {
-      throw new InvalidFieldException(String.format("[%s] is not valid.", parameterNode));
+      throw new IllegalArgumentException(String.format("[%s] is not valid.", parameterNode));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamPCollectionTable.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamPCollectionTable.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamPCollectionTable.java
index ff77497..f679ed7 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamPCollectionTable.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamPCollectionTable.java
@@ -17,7 +17,6 @@
  */
 package org.apache.beam.dsls.sql.schema;
 
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 import org.apache.beam.sdk.Pipeline;
 import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PCollection;
@@ -56,7 +55,7 @@ public class BeamPCollectionTable extends BaseBeamTable {
 
   @Override
   public PTransform<? super PCollection<BeamSqlRow>, PDone> buildIOWriter() {
-    throw new BeamInvalidOperatorException("cannot use [BeamPCollectionTable] as target");
+    throw new IllegalArgumentException("cannot use [BeamPCollectionTable] as target");
   }
 
 }

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRow.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRow.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRow.java
index a7e9f4b..eb311cf 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRow.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRow.java
@@ -24,8 +24,6 @@ import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
-
-import org.apache.beam.dsls.sql.exception.InvalidFieldException;
 import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
 import org.apache.beam.sdk.transforms.windowing.IntervalWindow;
 import org.apache.calcite.sql.type.SqlTypeName;
@@ -87,68 +85,68 @@ public class BeamSqlRow implements Serializable {
     switch (fieldType) {
       case INTEGER:
         if (!(fieldValue instanceof Integer)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case SMALLINT:
         if (!(fieldValue instanceof Short)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case TINYINT:
         if (!(fieldValue instanceof Byte)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case DOUBLE:
         if (!(fieldValue instanceof Double)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case BIGINT:
         if (!(fieldValue instanceof Long)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case FLOAT:
         if (!(fieldValue instanceof Float)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case DECIMAL:
         if (!(fieldValue instanceof BigDecimal)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case VARCHAR:
       case CHAR:
         if (!(fieldValue instanceof String)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case TIME:
         if (!(fieldValue instanceof GregorianCalendar)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       case TIMESTAMP:
       case DATE:
         if (!(fieldValue instanceof Date)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         }
         break;
       default:
-        throw new UnsupportedDataTypeException(fieldType);
+        throw new UnsupportedOperationException("Data type: " + fieldType + " not supported
yet!");
     }
     dataValues.set(index, fieldValue);
   }
@@ -208,49 +206,49 @@ public class BeamSqlRow implements Serializable {
     switch (fieldType) {
       case INTEGER:
         if (!(fieldValue instanceof Integer)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case SMALLINT:
         if (!(fieldValue instanceof Short)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case TINYINT:
         if (!(fieldValue instanceof Byte)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case DOUBLE:
         if (!(fieldValue instanceof Double)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case DECIMAL:
         if (!(fieldValue instanceof BigDecimal)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case BIGINT:
         if (!(fieldValue instanceof Long)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case FLOAT:
         if (!(fieldValue instanceof Float)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
@@ -258,27 +256,27 @@ public class BeamSqlRow implements Serializable {
       case VARCHAR:
       case CHAR:
         if (!(fieldValue instanceof String)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case TIME:
         if (!(fieldValue instanceof GregorianCalendar)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       case TIMESTAMP:
         if (!(fieldValue instanceof Date)) {
-          throw new InvalidFieldException(
+          throw new IllegalArgumentException(
               String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
         } else {
           return fieldValue;
         }
       default:
-        throw new UnsupportedDataTypeException(fieldType);
+        throw new UnsupportedOperationException("Data type: " + fieldType + " not supported
yet!");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRowCoder.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRowCoder.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRowCoder.java
index 6552dd3..bcbd481 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRowCoder.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamSqlRowCoder.java
@@ -96,7 +96,8 @@ public class BeamSqlRowCoder extends CustomCoder<BeamSqlRow> {
           break;
 
         default:
-          throw new UnsupportedDataTypeException(value.getDataType().getFieldsType().get(idx));
+          throw new UnsupportedOperationException(
+              "Data type: " + value.getDataType().getFieldsType().get(idx) + " not supported
yet!");
       }
     }
 
@@ -152,7 +153,8 @@ public class BeamSqlRowCoder extends CustomCoder<BeamSqlRow> {
           break;
 
         default:
-          throw new UnsupportedDataTypeException(tableSchema.getFieldsType().get(idx));
+          throw new UnsupportedOperationException("Data type: "
+              + tableSchema.getFieldsType().get(idx) + " not supported yet!");
       }
     }
 

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamTableUtils.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamTableUtils.java b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamTableUtils.java
index 134cf8f..1c1db91 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamTableUtils.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/BeamTableUtils.java
@@ -22,8 +22,6 @@ import java.io.IOException;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.math.BigDecimal;
-
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.util.NlsString;
 import org.apache.commons.csv.CSVFormat;
@@ -105,7 +103,7 @@ public final class BeamTableUtils {
           row.addField(idx, Double.valueOf(raw));
           break;
         default:
-          throw new BeamSqlUnsupportedException(
+          throw new UnsupportedOperationException(
               String.format("Column type %s is not supported yet!", columnType));
       }
     } else if (SqlTypeName.CHAR_TYPES.contains(columnType)) {

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/UnsupportedDataTypeException.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/UnsupportedDataTypeException.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/UnsupportedDataTypeException.java
deleted file mode 100644
index 3a496c2..0000000
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/schema/UnsupportedDataTypeException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed 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.beam.dsls.sql.schema;
-
-import org.apache.calcite.sql.type.SqlTypeName;
-
-/**
- * Exception when {@link SqlTypeName} is not supported.
- *
- */
-public class UnsupportedDataTypeException extends RuntimeException {
-
-  public UnsupportedDataTypeException(SqlTypeName unsupportedType){
-    super(String.format("Not support data type [%s]", unsupportedType));
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/main/java/org/apache/beam/dsls/sql/transform/BeamAggregationTransforms.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/transform/BeamAggregationTransforms.java
b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/transform/BeamAggregationTransforms.java
index a282ff9..51d3e89 100644
--- a/dsls/sql/src/main/java/org/apache/beam/dsls/sql/transform/BeamAggregationTransforms.java
+++ b/dsls/sql/src/main/java/org/apache/beam/dsls/sql/transform/BeamAggregationTransforms.java
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlExpression;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlInputRefExpression;
 import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlPrimitive;
@@ -207,7 +206,7 @@ public class BeamAggregationTransforms implements Serializable{
     private void verifySupportedAggregation(AggregateCall ac) {
       //donot support DISTINCT
       if (ac.isDistinct()) {
-        throw new BeamSqlUnsupportedException("DISTINCT is not supported yet.");
+        throw new UnsupportedOperationException("DISTINCT is not supported yet.");
       }
       String aggFnName = ac.getAggregation().getName();
       switch (aggFnName) {
@@ -221,7 +220,7 @@ public class BeamAggregationTransforms implements Serializable{
             .asList(SqlTypeName.INTEGER, SqlTypeName.BIGINT, SqlTypeName.FLOAT, SqlTypeName.DOUBLE,
                 SqlTypeName.SMALLINT, SqlTypeName.TINYINT)
             .contains(ac.type.getSqlTypeName())) {
-          throw new BeamSqlUnsupportedException(
+          throw new UnsupportedOperationException(
               "SUM only support for INT, LONG, FLOAT, DOUBLE, SMALLINT, TINYINT");
         }
         break;
@@ -232,7 +231,7 @@ public class BeamAggregationTransforms implements Serializable{
         if (!Arrays.asList(SqlTypeName.INTEGER, SqlTypeName.BIGINT, SqlTypeName.FLOAT,
             SqlTypeName.DOUBLE, SqlTypeName.SMALLINT, SqlTypeName.TINYINT,
             SqlTypeName.TIMESTAMP).contains(ac.type.getSqlTypeName())) {
-          throw new BeamSqlUnsupportedException("MAX/MIN only support for INT, LONG, FLOAT,"
+          throw new UnsupportedOperationException("MAX/MIN only support for INT, LONG, FLOAT,"
               + " DOUBLE, SMALLINT, TINYINT, TIMESTAMP");
         }
         break;
@@ -243,12 +242,12 @@ public class BeamAggregationTransforms implements Serializable{
             .asList(SqlTypeName.INTEGER, SqlTypeName.BIGINT, SqlTypeName.FLOAT, SqlTypeName.DOUBLE,
                 SqlTypeName.SMALLINT, SqlTypeName.TINYINT)
             .contains(ac.type.getSqlTypeName())) {
-          throw new BeamSqlUnsupportedException(
+          throw new UnsupportedOperationException(
               "AVG only support for INT, LONG, FLOAT, DOUBLE, SMALLINT, TINYINT");
         }
         break;
       default:
-        throw new BeamSqlUnsupportedException(
+        throw new UnsupportedOperationException(
             String.format("[%s] is not supported.", aggFnName));
       }
     }

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlInputRefExpressionTest.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlInputRefExpressionTest.java
b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlInputRefExpressionTest.java
index 8c19283..76e7a5a 100644
--- a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlInputRefExpressionTest.java
+++ b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlInputRefExpressionTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.beam.dsls.sql.interpreter.operator;
 
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 import org.apache.beam.dsls.sql.interpreter.BeamSqlFnExecutorTestBase;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.junit.Assert;
@@ -50,7 +49,7 @@ public class BeamSqlInputRefExpressionTest extends BeamSqlFnExecutorTestBase
{
     ref.evaluate(record).getValue();
   }
 
-  @Test(expected = BeamInvalidOperatorException.class)
+  @Test(expected = IllegalArgumentException.class)
   public void testTypeUnMatch(){
     BeamSqlInputRefExpression ref = new BeamSqlInputRefExpression(SqlTypeName.INTEGER, 0);
     ref.evaluate(record).getValue();

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitiveTest.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitiveTest.java
b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitiveTest.java
index 7cdc44e..eb51b6b 100644
--- a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitiveTest.java
+++ b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/interpreter/operator/BeamSqlPrimitiveTest.java
@@ -17,7 +17,6 @@
  */
 package org.apache.beam.dsls.sql.interpreter.operator;
 
-import org.apache.beam.dsls.sql.exception.BeamInvalidOperatorException;
 import org.apache.beam.dsls.sql.interpreter.BeamSqlFnExecutorTestBase;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.junit.Assert;
@@ -35,22 +34,22 @@ public class BeamSqlPrimitiveTest extends BeamSqlFnExecutorTestBase {
     Assert.assertEquals(expInt.getValue(), expInt.evaluate(record).getValue());
   }
 
-  @Test(expected = BeamInvalidOperatorException.class)
+  @Test(expected = IllegalArgumentException.class)
   public void testPrimitiveTypeUnMatch1(){
     BeamSqlPrimitive expInt = BeamSqlPrimitive.of(SqlTypeName.INTEGER, 100L);
     Assert.assertEquals(expInt.getValue(), expInt.evaluate(record).getValue());
   }
-  @Test(expected = BeamInvalidOperatorException.class)
+  @Test(expected = IllegalArgumentException.class)
   public void testPrimitiveTypeUnMatch2(){
     BeamSqlPrimitive expInt = BeamSqlPrimitive.of(SqlTypeName.DECIMAL, 100L);
     Assert.assertEquals(expInt.getValue(), expInt.evaluate(record).getValue());
   }
-  @Test(expected = BeamInvalidOperatorException.class)
+  @Test(expected = IllegalArgumentException.class)
   public void testPrimitiveTypeUnMatch3(){
     BeamSqlPrimitive expInt = BeamSqlPrimitive.of(SqlTypeName.FLOAT, 100L);
     Assert.assertEquals(expInt.getValue(), expInt.evaluate(record).getValue());
   }
-  @Test(expected = BeamInvalidOperatorException.class)
+  @Test(expected = IllegalArgumentException.class)
   public void testPrimitiveTypeUnMatch4(){
     BeamSqlPrimitive expInt = BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 100L);
     Assert.assertEquals(expInt.getValue(), expInt.evaluate(record).getValue());

http://git-wip-us.apache.org/repos/asf/beam/blob/83e6c204/dsls/sql/src/test/java/org/apache/beam/dsls/sql/rel/BeamSortRelTest.java
----------------------------------------------------------------------
diff --git a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/rel/BeamSortRelTest.java b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/rel/BeamSortRelTest.java
index 6667b46..cfdbd53 100644
--- a/dsls/sql/src/test/java/org/apache/beam/dsls/sql/rel/BeamSortRelTest.java
+++ b/dsls/sql/src/test/java/org/apache/beam/dsls/sql/rel/BeamSortRelTest.java
@@ -21,10 +21,8 @@ package org.apache.beam.dsls.sql.rel;
 import java.util.Collection;
 import java.util.Date;
 import java.util.Iterator;
-
 import org.apache.beam.dsls.sql.BeamSqlCli;
 import org.apache.beam.dsls.sql.BeamSqlEnv;
-import org.apache.beam.dsls.sql.exception.BeamSqlUnsupportedException;
 import org.apache.beam.dsls.sql.planner.MockedBeamSqlTable;
 import org.apache.beam.dsls.sql.schema.BeamSqlRow;
 import org.apache.beam.sdk.testing.TestPipeline;
@@ -214,7 +212,7 @@ public class BeamSortRelTest {
         ).getInputRecords(), MockedBeamSqlTable.CONTENT);
   }
 
-  @Test(expected = BeamSqlUnsupportedException.class)
+  @Test(expected = UnsupportedOperationException.class)
   public void testOrderBy_exception() throws Exception {
     String sql = "INSERT INTO SUB_ORDER_RAM(order_id, site_id)  SELECT "
         + " order_id, COUNT(*) "


Mime
View raw message